<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Home Decoration &amp; painters</title>
	<atom:link href="/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Local Painters in Edmonton</description>
	<lastBuildDate>Wed, 13 Jan 2021 05:09:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2.2</generator>

<image>
	<url>/wp-content/uploads/2018/03/cropped-logo-32x32.jpg</url>
	<title>Home Decoration &amp; painters</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What is MVC architecture in web application development?</title>
		<link>/2021/01/13/what-is-mvc-architecture-in-web-application-development/</link>
		
		<dc:creator><![CDATA[YUDHVIR]]></dc:creator>
		<pubDate>Wed, 13 Jan 2021 05:05:06 +0000</pubDate>
				<category><![CDATA[Research Topics]]></category>
		<guid isPermaLink="false">/?p=310</guid>

					<description><![CDATA[Model, view and controller (MVC) is a well-known three-layer development architecture used for web application development. It divides the characteristics of the application. The model-view-controller pattern suggests three main components to be used in software development: A&#160;Model, which describes the underlying logical structure of data in a software application. The...]]></description>
										<content:encoded><![CDATA[
<p>Model, view and controller (MVC) is a well-known three-layer development architecture used for web application development. It divides the characteristics of the application.</p>



<p>The model-view-controller pattern suggests three main components to be used in software development:</p>



<ul><li>A&nbsp;<em>Model</em>, which describes the underlying logical structure of data in a software application. The model component does not contain any information about the user interface.</li><li>A&nbsp;<em>View</em>, which explains the elements in the user interface (all of the things the user can see and respond to on the screen, such as buttons, display boxes, and so forth)</li><li>A&nbsp;<em>Controller</em>, which defines connecting the model and the view, and is used to communicate between characters in the model and view.</li></ul>



<p>MVC provides very loose coupling between these three layers. MVC patterns provide the facility of parallel development. It means that each layer of the application is independent of each other i.e. different developers can work on the single application simultaneously. One team can work on user input logic (controller logic), and the second team can work on the user interface logic (view) and some others can work on the business logic (model) at the same time.</p>



<p>The MVC pattern is widely used in development with programming languages such as Java, .NET, PHP. The MVC pattern has been proclaimed by many developers as a useful pattern for the reuse of object code and a model that lets them to significantly decrease the time it takes to produce applications with user interfaces.</p>



<p><strong>Advantages of using MVC framework</strong></p>



<ul><li>It saves time with faster development process</li><li>It enables the user interface to display multiple views of the same data at the same time.</li><li>The modification does not affect the entire model: MVC makes it easy to change the view, as every layer is independent. User Interface can be updated without slowing down or interfering the business logic process.</li><li>MVC provide ease to create SEO friendly URL’s</li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Web performance and why it matters</title>
		<link>/2021/01/13/web-performance-and-why-it-matters/</link>
		
		<dc:creator><![CDATA[YUDHVIR]]></dc:creator>
		<pubDate>Wed, 13 Jan 2021 05:04:16 +0000</pubDate>
				<category><![CDATA[Research Topics]]></category>
		<guid isPermaLink="false">/?p=308</guid>

					<description><![CDATA[To create a website more feature-rich, we push it to do more. Presently websites have more features than ever before. All this leads to a common problem of performance. Many websites struggle to perform on various devices and networks. The problem can be so worse that sometimes websites are completely...]]></description>
										<content:encoded><![CDATA[
<p>To create a website more feature-rich, we push it to do more. Presently websites have more features than ever before. All this leads to a common problem of performance. Many websites struggle to perform on various devices and networks. The problem can be so worse that sometimes websites are completely inaccessible or do not respond to user inputs.</p>



<h2 class="wp-block-heading">Why performance matters</h2>



<p><strong>To retain users</strong> – High performing websites engage and retain users much better than non-performing sites. It doesn’t matter how beautiful a site is, for every delay in site load, you lose some users. Performance plays a major role in the success of any online investment.</p>



<p><strong>To improve conversions</strong> – A high performing website has a positive impact on revenue.</p>



<p><strong>It Improves UX</strong> – Slow sites make a user wait and there’s no user experience to speak of. Waiting time on every user response creates more problems. Even if we have a faster network, mobile devices have limited CPU power and memory. They might perform under if we have no code optimization.</p>



<p><strong>Performance is about cost</strong> – Most of the user access the web on mobile devices through 4G, 3G maybe even 2G networks with limited data plans. Low performing sites can increase user costs which leads to more limited users.</p>



<h2 class="wp-block-heading">How to achieve performance</h2>



<p><strong>Check for the resources you send and receive</strong> – Resources like heavy CSS and JavaScript frameworks are great, but use only if you need them. Such resources create heaps of CSS and JavaScript files, the browser needs to download. If we need any framework, go for a lightweight alternative. Not all websites need to be single-page applications, as they often make extensive use of JavaScript.</p>



<p><strong>Minify text assets</strong> – minifying JS and CSS makes website smaller and loads faster. It removes white-space, strips comments, combines files and optimizes some common programming patterns.</p>



<p><strong>Reduce HTTP requests or Migrate to HTTP/2</strong> – In general, the more HTTP requests your web page makes the slower it will load. Consider using Code splitting in a webpack. This allows you to split your code into various bundles which can then be loaded on demand or in parallel.</p>



<p><strong>Optimize images</strong> – Image optimization is about reducing a image size without sacrificing image quality, which makes web page loads fast. Use new web standard image formats like JPG 2000 and WebP for raster images and SVG for vector images.</p>



<p><strong>Serve scaled images with alt attribute</strong> – Image size should be adjusted to match the exact size required for a site.</p>



<p><strong>Deliver images responsively (srcset attribute)</strong> – we can send different images for devices with different screen sizes and resolutions, that work well on them.</p>



<p><strong>Reduce assets such as third-party plugins</strong> that make a large number of external requests. Don’t use them unless they are really needed.</p>



<p><strong>Inspect render-blocking resources</strong> – Check for what might be blocking the DOM causing the delay in your page load time. Use defer or async directive to avoid render-blocking JavaScript.</p>



<p><strong>Reduce latency with a content delivery network (CDN)</strong> – CDN is an interconnected system of computers on the internet that provide web content rapidly to users by duplicating or caching the content on multiple servers and directing the content to users on proximity.</p>



<p><strong>Caching resources</strong> – The performance of web sites and applications can be significantly improved by reusing previously fetched resources. web caches reduce latency and network traffic. By making use of HTTP caching, web sites become more responsive.</p>



<p><strong>Hotlink protection</strong> – It allows you to prevent other websites from directly linking to files from your website.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Progressive Web Apps</title>
		<link>/2021/01/13/progressive-web-apps/</link>
		
		<dc:creator><![CDATA[YUDHVIR]]></dc:creator>
		<pubDate>Wed, 13 Jan 2021 05:02:59 +0000</pubDate>
				<category><![CDATA[Research Topics]]></category>
		<guid isPermaLink="false">/?p=306</guid>

					<description><![CDATA[Progressive Web App (PWA)&#160;is application software delivered through the web, uses web browser APIs and features along with progressive enhancement approach to bring a native app-like user experience to cross-platform web applications. It is intended to work on any platform that uses a standards-compliant browser. PWA can be thought of...]]></description>
										<content:encoded><![CDATA[
<p><strong>Progressive Web App (PWA)&nbsp;</strong>is application software delivered through the web, uses web browser APIs and features along with progressive enhancement approach to bring a native app-like user experience to cross-platform web applications. It is intended to work on any platform that uses a standards-compliant browser. PWA can be thought of as similar to AJAX or other related models that incorporate a set of application characteristics, including use of specific web technologies and techniques. PWA includes functionality like working offline, push notifications, and device hardware access, enabling creating user experiences similar to native applications on destop and mobile devices.&nbsp;</p>



<p>PWAs give us the ability to create web apps that take benefit of both web and native app features. Web apps are more discoverable than native apps, it’s a lot easier and fater to visit a website than to install an application, and you can also share web apps by simply sending a link. On the other hand, native apps are better integrated with the operating system and therefore offer a more seamless experience for the users. You can install a native app so that it works offline, and users can easily access their favorite apps through icons, rather than navigating to it using a browser.&nbsp;</p>



<p>There are many commonly used technologies to create progressive web apps. To call a Web App a PWA, technically speaking it should have the following features: It must run under&nbsp;Secure contexts&nbsp;(HTTPS), must implement a&nbsp;Service Worker, and a&nbsp;manifest file.</p>



<h3 class="wp-block-heading">The PWA approach is characterized by the following set of attributes:</h3>



<ol><li>Responsive</li><li>Connectivity independent</li><li>App-like interactions</li><li>Fresh</li><li>Safe</li><li>Discoverable</li><li>Re-engageable</li><li>Installable</li><li>Linkable</li></ol>



<h3 class="wp-block-heading">Benefits of PWA</h3>



<ul><li>Cheaper than other apps</li><li>Count towards SEO</li><li>lower usage threshold</li><li>not dependent on app stores</li></ul>



<h3 class="wp-block-heading">Disadvantages of PWA</h3>



<ul><li>Fewer functionalities and therefore less UX</li><li>No access to innovations (Such as Bluetooth or NFC)</li><li>No extra room for business model&nbsp;</li></ul>



<p>References:</p>



<p><a href="https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps">https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps</a></p>



<p><a href="https://en.wikipedia.org/wiki/Progressive_web_application">https://en.wikipedia.org/wiki/Progressive_web_application</a></p>



<p><a href="https://medium.com/@amberleyjohanna/seriously-though-what-is-a-progressive-web-app-56130600a093">https://medium.com/@amberleyjohanna/seriously-though-what-is-a-progressive-web-app-56130600a093</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>What is Serverless computing?</title>
		<link>/2021/01/13/what-is-serverless-computing/</link>
		
		<dc:creator><![CDATA[YUDHVIR]]></dc:creator>
		<pubDate>Wed, 13 Jan 2021 05:02:05 +0000</pubDate>
				<category><![CDATA[Research Topics]]></category>
		<guid isPermaLink="false">/?p=304</guid>

					<description><![CDATA[Serverless computing&#160;is a&#160;cloud computing&#160;execution model&#160;in which the cloud provider runs the&#160;server, and dynamically manages the allocation of machine resources. Pricing is based on the actual amount of resources consumed by an application, rather than on pre-purchased units of capacity. Wikipedia definition The Serverless computing provides developers a platform which removes...]]></description>
										<content:encoded><![CDATA[
<blockquote class="wp-block-quote"><p><strong>Serverless computing</strong>&nbsp;is a&nbsp;cloud computing&nbsp;execution model&nbsp;in which the cloud provider runs the&nbsp;server, and dynamically manages the allocation of machine resources. Pricing is based on the actual amount of resources consumed by an application, rather than on pre-purchased units of capacity.</p><cite>Wikipedia definition</cite></blockquote>



<p>The Serverless computing provides developers a platform which removes the need for managing server software and hardware. Application can divide into individual functions, which can be used and scaled separately. On a serverless architecture, you only focus on standalone functions in the application code.</p>



<p>With serverless computing, you get backend services on an as-used basis. Developers can deploy code without bothering about the underlying foundation. Traditional server charges for a set bandwidth or number of servers, whether they are used or not. This results in lots of server space went to waste. On the other hand, serverless computing provides an auto-scaling model, which reduces cost by only charging for the services you use.</p>



<p>Serverless computing doesn’t mean there is no server, it is the developer who do not need to be aware of it. The term ‘serverless’ is somewhat misleading, as there are still servers providing these backend services, but all of the server space and infrastructure concerns are handled by the vendor. Serverless means that the developers can do their work without having to worry about servers at all.</p>



<h3 class="wp-block-heading">Services serverless computing provides</h3>



<p>Serverless service providers mostly offer database and storage services and many also have Function-as-a-Service (FaaS)&nbsp;platforms. These platforms can execute pieces of code on the edge without storing any data.</p>



<h3 class="wp-block-heading">Advantages of serverless computing</h3>



<ul><li>Lower costs</li><li>Simplified scalability</li><li>Simplified back-end code</li><li>Quicker turnaround</li></ul>



<h3 class="wp-block-heading">Top Serverless Vendors</h3>



<ul><li>AWS Lambda</li><li>Cloudflare Workers</li><li>Google Cloud Functions</li><li>IBM Cloud Functions</li><li>Microsoft Azure Functions</li><li>Oracle Functions</li></ul>



<h3 class="wp-block-heading">Who Should Use Serverless?</h3>



<p>The serverless model is best if you need a small number of functions to be hosted. Although a complex application can still take benefits. If you have an existing application, it may not be feasible to build all in one go, gradually migrating small pieces of the application into serverless functions makes more sense.</p>



<p>References:</p>



<p><a href="https://www.twilio.com/docs/glossary/what-is-serverless-architecture">https://www.twilio.com/docs/glossary/what-is-serverless-architecture</a></p>



<p><a href="https://hackernoon.com/what-is-serverless-architecture-what-are-its-pros-and-cons-cc4b804022e9">https://hackernoon.com/what-is-serverless-architecture-what-are-its-pros-and-cons-cc4b804022e9</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>What are APIs, Web service APIs and Types?</title>
		<link>/2021/01/13/what-are-apis-web-service-apis-and-types/</link>
		
		<dc:creator><![CDATA[YUDHVIR]]></dc:creator>
		<pubDate>Wed, 13 Jan 2021 05:01:02 +0000</pubDate>
				<category><![CDATA[Research Topics]]></category>
		<guid isPermaLink="false">/?p=302</guid>

					<description><![CDATA[APIs APIs (Application Programming Interface) is a set of procedures and functions used to create applications that can communicate with the features or data of other applications or an operating system. For example, many websites show reviews and ratings from other third-party website so they use APIs from other application...]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">APIs</h2>



<p>APIs (Application Programming Interface) is a set of procedures and functions used to create applications that can communicate with the features or data of other applications or an operating system. For example, many websites show reviews and ratings from other third-party website so they use APIs from other application on their website to display their reviews and ratings.</p>



<p>APIs are helpful to developers because they can easily add specific functionality or access data to their application, without rewriting all of the code.</p>



<p>Usually, APIs are referred to as web APIs. However, APIs can be two local applications that don’t require a network to communicate with each other.</p>



<h2 class="wp-block-heading">Web service APIs</h2>



<p>Web service APIs are small applications that utilize URLs on the internet to provide their services to other web applications. &nbsp;It is a method for two machines to interact with each other over a network. A web-server running on a computer listens to requests from other computers. When a request is received, the web service returns the requested resources, which could an HTML file, JSON or XML type. A Web service is simply an API wrapped in HTTP.&nbsp; A Web service might not include a complete set of specifications and sometimes might not be able to perform all the tasks that may be possible from a complete API.</p>



<p>“All Web Services are APIs, but not all APIs are Web services.”</p>



<h2 class="wp-block-heading">SOAP vs REST APIs</h2>



<h3 class="wp-block-heading">SOAP (Simple Object Access Protocol)</h3>



<p>SOAP messaging protocol specifications in terms of the level of security and the approach to send messages are more defined than REST. SOAP grants comprehensive security, built-in ACID (Atomicity, Consistency, Isolation, Durability) compliance and reliable messaging functionality which makes it more suitable for enterprise applications like banking transactions, LDAP interaction and more.</p>



<p>SOAP allows processes running on different operating systems (such as Windows, macOS, and Linux) to connect and communicate using XML (Extensible Markup Language). The devices don’t need to use the same platforms because they both understand the language of XML.</p>



<h3 class="wp-block-heading">REST (Representational State Transfer)</h3>



<p>A&nbsp;<strong>REST API</strong>&nbsp;is a standardized architecture style for creating a Web Service API. REST APIs are based on URIs (Uniform Resource Identifier) HTTP protocol and uses different data formats like JSON, HTML, XML and plain text for sending messages, which are super browser-compatible. The usage of simpler data formats makes the payloads lighter which makes REST APIs be more desirable for a wider range of applications. REST APIs are simple to build and scale as opposed to other types of APIs. REST APIs use SSL security which means it can use HTTPS.&nbsp;</p>



<h3 class="wp-block-heading">What does stateless mean in REST?</h3>



<p>In REST architecture, the server does not store any state of the client session on the server-side. Each request from the client must contain all of the information required to understand by the server. The client is responsible for storing and handling all application state-related information on the client-side. It also means that the client is responsible for sending any state information to the server whenever it is needed. Because, there is not session affinity or sticky sessions on the server the connection is stateless.</p>



<h4 class="wp-block-heading">Resources:</h4>



<p><a href="https://www.decipherzone.com/blog-detail/Types-of-APIs">https://www.decipherzone.com/blog-detail/Types-of-APIs</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Data Visualization</title>
		<link>/2021/01/13/data-visualization/</link>
		
		<dc:creator><![CDATA[YUDHVIR]]></dc:creator>
		<pubDate>Wed, 13 Jan 2021 05:00:06 +0000</pubDate>
				<category><![CDATA[Research Topics]]></category>
		<guid isPermaLink="false">/?p=300</guid>

					<description><![CDATA[Data visualization means visually displaying data or using raw data into insights that can be easily interpreted by the viewer.&#160; “Wikipedia’s definition of Data Visualization: Data visualization refers to the techniques used to communicate data or information by encoding it as visual objects (points, lines or bars) contained in graphics.”...]]></description>
										<content:encoded><![CDATA[
<p>Data visualization means visually displaying data or using raw data into insights that can be easily interpreted by the viewer.&nbsp;</p>



<blockquote class="wp-block-quote"><p>“Wikipedia’s definition of Data Visualization: Data visualization refers to the techniques used to communicate data or information by encoding it as visual objects (points, lines or bars) contained in graphics.”</p></blockquote>



<p>To be highly effective visualization, it is important to design the right visualization for the data so that users can interpret and make decisions based on what they observe.&nbsp;&nbsp;</p>



<p><strong>General types of data visualization:</strong></p>



<p>Charts, Tables, Graphs, Maps, Info-graphics, Dashboards</p>



<p><strong>More specific types of data visualization:&nbsp;</strong></p>



<p>Area Chart, Bar Chart, Gantt Chart, Heat Map, Highlight Table, Bullet Graph, Circle View, Histogram, Matrix, Bubble Cloud, Dot Distribution Map,</p>



<h3 class="wp-block-heading">Data Visualization tools:</h3>



<p>The most common tool for ordinary users is Excel. For more sophisticated abilities, we have Tableau, D3.js, Microsoft Power BI, Oracle Visual Analyzer, Google Charts etc.</p>



<h3 class="wp-block-heading">About D3.js</h3>



<p>D3 produces interactive data visualization in web browsers. D3.js, as the name suggests (Data Driven Documents), it’s a JavaScript library used to manipulate DOM objects using data. D3.js offers high flexibility and providing you to implement complex data. D3.js can be used for data range from few bits to gigabits.</p>



<p>D3 uses HTML, SVG and CSS to bring data to life. D3 follows web standards and uses full capabilities of latest browsers. You can use D3 to generate an HTML table or create an interactive, dynamic SVG charts. The D3.js uses pre-build functions to select elements and create SVG objects. You can style or add transitions to these objects. D3 is extremely fast and supports large datasets in various formats such as JSON, CSV.</p>



<h3 class="wp-block-heading">Installing D3.js</h3>



<p>You can install using npm (npm install d3) . You can also download or load directly from d3j.org.&nbsp;</p>



<p>References:</p>



<p><a href="https://d3js.org/">https://d3js.org/</a></p>



<p><a href="https://en.wikipedia.org/wiki/D3.js">https://en.wikipedia.org/wiki/D3.js</a></p>



<p><a href="https://towardsdatascience.com/9-data-visualization-tools-that-you-cannot-miss-in-2019-3ff23222a927">https://towardsdatascience.com/9-data-visualization-tools-that-you-cannot-miss-in-2019-3ff23222a927</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>React Router</title>
		<link>/2021/01/13/react-router/</link>
		
		<dc:creator><![CDATA[YUDHVIR]]></dc:creator>
		<pubDate>Wed, 13 Jan 2021 04:57:57 +0000</pubDate>
				<category><![CDATA[Research Topics]]></category>
		<guid isPermaLink="false">/?p=298</guid>

					<description><![CDATA[Routing is the ability to navigate within different parts of an application when a user enters a URL or clicks an element such as link, button or image within the application.]]></description>
										<content:encoded><![CDATA[
<p>Routing is the ability to navigate within different parts of an application when a user enters a URL or clicks an element such as link, button or image within the application.</p>



<h2 class="wp-block-heading">What is react router?</h2>



<p>React router is a routing library built on top of the react which is used to create the routing in react apps. React Router conditionally render certain components to display depending on the&nbsp;<em>route</em>&nbsp;being used in the URL (<code>/</code>&nbsp;for the home page,&nbsp;<code>/about</code>&nbsp;for the about page, etc.).</p>



<p>In the below example, we are using the&nbsp;<code><strong>BrowserRouter</strong></code>&nbsp;with the assumption that the server running the application is dynamic.</p>



<h2 class="wp-block-heading">Installing the React Router</h2>



<div class="wp-block-columns is-layout-flex wp-container-2">
<div class="wp-block-column is-layout-flow" style="flex-basis:100%">
<pre class="wp-block-preformatted">npm i react-router-dom</pre>
</div>
</div>



<h2 class="wp-block-heading">Creating components and Router</h2>



<p>Open the App.js file and import the components. In this example we have Home, About and Contact.</p>



<p>React router gives us four components Route, Link, BrowserRouter and Switch which help us to implement the routing. You’ll need to import <code>BrowserRouter</code>, <code>Route</code>, and <code>Switch</code> from&nbsp;<code>react-router-dom</code>&nbsp;package:</p>



<p>file: <em>/App.js</em></p>



<div class="wp-block-columns is-layout-flex wp-container-4">
<div class="wp-block-column is-layout-flow" style="flex-basis:100%">
<pre class="wp-block-code"><code>import&nbsp;React, { Fragment }&nbsp;from&nbsp;'react';
import&nbsp;{ BrowserRouter&nbsp;as&nbsp;Router, Switch, Route }&nbsp;from&nbsp;"react-router-dom";
import&nbsp;AppHeader&nbsp;from&nbsp;'./components/AppHeader';
import&nbsp;Home&nbsp;from&nbsp;'./pages/home';
import&nbsp;About&nbsp;from&nbsp;'./pages/about';
import&nbsp;Contact&nbsp;from&nbsp;'./pages/contact';

function&nbsp;App()&nbsp;{
&nbsp;&nbsp;return&nbsp;(
&nbsp;&nbsp;&nbsp;&nbsp;&lt;Fragment&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Router&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;AppHeader&nbsp;/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;main&gt;
          &lt;Switch&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &lt;Route&nbsp;exact&nbsp;path="/"&nbsp;component={Home}&nbsp;/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &lt;Route&nbsp;exact&nbsp;path="/about"&nbsp;component={About}&nbsp;/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;Route&nbsp;exact&nbsp;path="/contact"&nbsp;component={Contact}&nbsp;/&gt;
          &lt;/Switch&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/main&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Router&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Fragment&gt;
&nbsp;&nbsp;);
}
export&nbsp;default&nbsp;(App);</code></pre>
</div>
</div>



<p>The&nbsp;<code><strong>&lt;Route/&gt;</strong></code>&nbsp;component is one of the most important building blocks in the React Router package. It renders the appropriate user interface when the current location matches the route’s&nbsp;<code><strong>path</strong></code>. In the Route component, we need to pass the two props, one is path and second component. The&nbsp;<code><strong>path</strong></code> describes the pathname that the route should match. The component prop describes the component user needs to see when they will navigate to that path.</p>



<p>The react-router library also contains a&nbsp;<code><strong>&lt;Switch/&gt;</strong></code>&nbsp;component that is used to wrap multiple &nbsp;<code><strong>&lt;Route/&gt;</strong></code>&nbsp; components. The&nbsp;<code><strong>Switch</strong></code>&nbsp;component&nbsp;<strong>only</strong>&nbsp;picks the&nbsp;<strong>first</strong>&nbsp;matching route among all its children routes.</p>



<p>Now if you enter manually localhost:3000/about you will see About component is rendered.</p>



<h2 class="wp-block-heading">Adding Navigation using Link component</h2>



<p>The react-router package also contains a&nbsp;<code><strong>&lt;Link/&gt;</strong></code>&nbsp;component that is used to navigate the different parts of an application by way of hyperlinks. It is similar to HTML’s anchor element but the main difference is that using the&nbsp;<code><strong>Link</strong></code>&nbsp;component does not reload the page but rather, changes the UI. Using an anchor tag would require that the page is reloaded in order to load the new UI. When the&nbsp;<code><strong>Link</strong></code>&nbsp;component is clicked, it also updates the URL.</p>



<p>File: <em>./components/AppHeader.js</em></p>



<div class="wp-block-columns is-layout-flex wp-container-6">
<div class="wp-block-column is-layout-flow" style="flex-basis:100%">
<pre class="wp-block-code"><code>import&nbsp;React&nbsp;from&nbsp;'react';
import&nbsp;{&nbsp;Link&nbsp;}&nbsp;from&nbsp;'react-router-dom';
const&nbsp;AppHeader&nbsp;=&nbsp;()&nbsp;=&gt;&nbsp;(
     &lt;header&gt;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;    &lt;nav&nbsp;className="site-main-nav"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;Link&nbsp;to="/"&gt;Home&lt;/Link&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;Link&nbsp;to="/about"&gt;About&lt;/Link&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;Link&nbsp;to="/contact"&gt;Contact&nbsp;Us&lt;/Link&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ul&gt;
        &lt;/nav&gt;
     &lt;/header&gt;
);
export&nbsp;default&nbsp;AppHeader;</code></pre>
</div>
</div>



<p>After adding navigation you will see the routes are rendered on the screen. if you click on the navigation links you will see url is changing and appropriate navigation components are rendered.</p>



<p>The&nbsp;<code><strong>&lt;Link/&gt;</strong></code>&nbsp;component uses&nbsp;<code>to</code>&nbsp;as a prop to define the&nbsp;<code><strong>location</strong></code>&nbsp;to navigate to. This prop can either be a string or a&nbsp;<code><strong>location</strong></code>&nbsp;object. If it is a string, it is converted to a&nbsp;<code><strong>location</strong></code>&nbsp;object. Note that the pathname&nbsp;<strong>must</strong>&nbsp;be absolute.</p>



<h2 class="wp-block-heading">Adding 404 Pages</h2>



<p>We need to import another component called Switch which is provided by the react router. Switch component helps us to render the components only when path matches otherwise it fallbacks to the not found component.</p>



<p>File: <em>./pages/404.js</em></p>



<div class="wp-block-columns is-layout-flex wp-container-8">
<div class="wp-block-column is-layout-flow" style="flex-basis:100%">
<pre class="wp-block-code"><code>import React from 'react'
const Notfound = () =&gt; (
       &lt;h1&gt;Page Not Found&lt;/h1&gt;
)
export default Notfound</code></pre>
</div>
</div>



<p>File: <em>/App.js</em></p>



<div class="wp-block-columns is-layout-flex wp-container-10">
<div class="wp-block-column is-layout-flow" style="flex-basis:100%">
<pre class="wp-block-code"><code>import&nbsp;React, { Fragment }&nbsp;from&nbsp;'react';
import&nbsp;{ BrowserRouter&nbsp;as&nbsp;Router, Switch, Route }&nbsp;from&nbsp;"react-router-dom";
import&nbsp;AppHeader&nbsp;from&nbsp;'./components/AppHeader';
import&nbsp;Home&nbsp;from&nbsp;'./pages/home';
import&nbsp;About&nbsp;from&nbsp;'./pages/about';
import&nbsp;Contact&nbsp;from&nbsp;'./pages/contact';
import NotFound from './pages/404';

function&nbsp;App()&nbsp;{
&nbsp;&nbsp;return&nbsp;(
&nbsp;&nbsp;&nbsp;&nbsp;&lt;Fragment&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Router&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;AppHeader&nbsp;/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;main&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Switch&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Route&nbsp;exact&nbsp;path="/"&nbsp;component={Home}&nbsp;/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Route&nbsp;exact&nbsp;path="/about"&nbsp;component={About}&nbsp;/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &lt;Route&nbsp;exact&nbsp;path="/contact"&nbsp;component={Contact}&nbsp;/&gt;
            &lt;Route component={NotFound} /&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Switch&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/main&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Router&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Fragment&gt;
&nbsp;&nbsp;);
}
export&nbsp;default&nbsp;(App);</code></pre>
</div>
</div>



<p>Let’s check it now by manually entering wrong path “localhost:3000/pagenotfound”. you we see NotFound component rendered.</p>



<h3 class="wp-block-heading">Conclusion</h3>



<p>React Router is a clean and organized method and makes adding and deleting pages easier. It’s easy to navigate around a React app, without using anchor tags.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
