<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mueez sanwo on Medium]]></title>
        <description><![CDATA[Stories by Mueez sanwo on Medium]]></description>
        <link>https://medium.com/@mueezsanwo?source=rss-2c9d422a3731------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Mueez sanwo on Medium</title>
            <link>https://medium.com/@mueezsanwo?source=rss-2c9d422a3731------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 03:52:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mueezsanwo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Stutern Housemanship — Deliverycog Documentation by Sanwo Mueez]]></title>
            <link>https://medium.com/@mueezsanwo/stutern-housemanship-deliverycog-documentation-by-sanwo-mueez-889b52e6edc?source=rss-2c9d422a3731------2</link>
            <guid isPermaLink="false">https://medium.com/p/889b52e6edc</guid>
            <category><![CDATA[react-router-dom]]></category>
            <category><![CDATA[stutern-housemanship]]></category>
            <dc:creator><![CDATA[Mueez sanwo]]></dc:creator>
            <pubDate>Tue, 18 Oct 2022 11:25:18 GMT</pubDate>
            <atom:updated>2022-12-12T06:54:43.623Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1bdaMpRtfj1a4DiEiC7oZg.png" /><figcaption>Article Cover</figcaption></figure><h4><strong>Task 1: Implementing React-Router-Dom</strong></h4><p>React Router DOM is an npm package that enables you to implement dynamic routing in a web app. It allows you to display pages and allow users to navigate them. It is a fully-featured client and server-side routing library for React. React Router Dom is used to build single-page applications i.e. applications that have many pages or components but the page is never refreshed instead the content is dynamically fetched based on the URL. This process is called Routing and it is made possible with the help of React Router Dom.</p><p>The major advantage of react-router is that the page does not have to be refreshed when a link to another page is clicked, for example. Moreover, it is fast, very fast compared to traditional page navigation. This means that the user experience is better and the app has overall better performance.</p><p>React Router Dom has many useful components and to create fully functioning routing, you need most of these.</p><ol><li><strong>Router(usually imported as BrowserRouter): </strong>It is the parent component that is used to store all of the other components. Everything within this will be part of the routing functionality</li><li><strong>Switch:</strong> Switch component is used to render only the first route that matches the location rather than rendering all matching routes.</li><li><strong>Route:</strong> This component checks the current URL and displays the component associated with that exact path. All routes are placed within the switch components.</li><li><strong>Link:</strong> Link component is used to create links to different routes.</li></ol><p>The Route component takes 2 parameters. The first one is the path that will be in the url and the second is the component that will be displayed if the current URL matches the path in the first parameter.</p><h4><strong>Steps to implement</strong></h4><p><strong>Step 1:</strong> <em>install react-router-dom</em></p><p><strong>|</strong> npm install react-router-dom</p><p><strong>Step 2:</strong> Open the index.js file in the src folder and import BrowserRouter from react-router-dom and then wrap the root component (the App component) in it.</p><p><strong>Step 3:</strong> Open the index.js file in the src folder and import createBrowserHistory from History and then export const history = createBrowserHistory(); .</p><p>This is what the index.js looked like initially:</p><pre>import React from &#39;react&#39;;<br>import ReactDOM from &#39;react-dom&#39;;<br>import &#39;./index.css&#39;;<br>import App from &#39;./App&#39;;</pre><pre>ReactDOM.render(<br>  &lt;React.StrictMode&gt;<br>    &lt;App /&gt;<br>  &lt;/React.StrictMode&gt;,<br>  document.getElementById(&#39;root&#39;)<br>);</pre><p>After making changes with React Router, this is what you should have:</p><pre>import React from &#39;react&#39;;<br>import ReactDOM from &#39;react-dom&#39;;<br>import &#39;./index.css&#39;;<br>import App from &#39;./App&#39;;<br>import { BrowserRouter } from &quot;react-router-dom&quot;;<br>import { createBrowserHistory } from &quot;history&quot;;</pre><pre>export const history = createBrowserHistory();</pre><pre>ReactDOM.render(<br>  &lt;BrowserRouter&gt;<br>    &lt;App /&gt;<br>  &lt;/BrowserRouter&gt;,<br>  document.getElementById(&quot;root&quot;)<br>);</pre><p>All we did was replace React.StrictMode with BrowserRouter which was imported from react-router-dom. Now the router features are accessible from any part of your app.</p><h4>Task 2: Implementing Axios</h4><h4>What is Axios?</h4><p>Axios is a popular library that is mainly used to send asynchronous HTTP requests to REST endpoints. This library is very useful to perform CRUD operations.</p><p>This popular library is used to communicate with the backend. Axios supports the Promise API, native to JS ES6.</p><p>Using Axios we make API requests in our application. Once the request is made we get the data in Return, and then we use this data in our project.</p><h4>Features</h4><ul><li>Make <a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest">XMLHttpRequests</a> from the browser</li><li>Make <a href="http://nodejs.org/api/http.html">http</a> requests from node.js</li><li>Supports the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a> API</li><li>Intercept request and response</li><li>Transform request and response data</li><li>Cancel requests</li><li>Automatic transforms for JSON data</li><li>Client side support for protecting against <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">XSRF</a></li></ul><h4>Steps to implement axios</h4><p><strong>Step 1: </strong>Install axios library using the command given below…</p><pre>npm install axios</pre><h4>Task 3A: Implement layout and functionality for verifying an email address</h4><p>This page displays after a new user completes the sign up process and click the continue button.</p><p>The user verifies the email address and then clicks the okay button to continue to log in.</p><h4><strong>Steps to implement the layout and functionality for verifying an email address</strong></h4><p><strong>Step 1: </strong>Create a file in the pages folder inside the src folder and name it <strong>“verifyEmail.js”</strong></p><p><strong>Step 2: </strong>Create a react functional component and write the code for the layout inside the above file that was created.</p><p><strong>Step 3: </strong>Create a <strong>URL</strong> for the “VerifyEmail.js file” inside url.js component.</p><pre>verifyEmail: &quot;/verify-email&quot;,</pre><p><strong>Step 4: </strong>Create a <strong>router</strong> for the “verifyEmail.js file” inside the router.js file. Also, import the “verifyEmail.js file” into the router.js file.</p><pre>&lt;Route path={NonAuthRoutes.verifyEmail} element={&lt;VerifyEmail /&gt;} /&gt;import VerifyEmail from &quot;./pages/verifyEmail&quot;;</pre><p><strong>Step 5: </strong>In the verifyEmail.js file,<strong> d</strong>irect the verify-email page to the log-in page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yG2aAOYqvcr8gRdGtjJaYw.jpeg" /></figure><p><strong>Step 6: </strong>Finally, I worked on the code to implement the layout of the page above. Below is the GitHub link to the code</p><p><a href="https://github.com/StuternHousemanship/DELIVERYCOG-Frontend-Project-Team1.1/blob/DYC-1_Onboarding_Features/src/pages/emailVerificationPage.js">DELIVERYCOG-Frontend-Project-Team1.1/emailVerificationPage.js at DYC-1_Onboarding_Features · StuternHousemanship/DELIVERYCOG-Frontend-Project-Team1.1 · GitHub</a></p><h4>Task 3<strong>B</strong> : Implement layout and functionality for logging out</h4><p>This is used to logout of the application and back to the landing page.</p><h4>Steps to Implement layout and functionality for logging out</h4><p><strong>step 1:</strong> In the dashboard.js file, import useNavigate from react-router-dom.</p><pre>import { useNavigate } from &quot;react-router-dom&quot;;</pre><p><strong>step 2: </strong>create a function that handles the funtionality of the log out button when clicked by the user. This redirects the user to the landing page.</p><pre><br>const navigate = useNavigate();</pre><pre>// To log out from Dashboard</pre><pre>const handleLogOut = (e) =&gt; {</pre><pre>e.preventDefault();</pre><pre>// CLEAR DATA FROM STORAGE</pre><pre>localStorage.clear();</pre><pre>sessionStorage.clear();</pre><pre>navigate(&quot;/&quot;);</pre><p><strong>step 3:</strong> The log out button (onClick) takes the handleLogOut as it’s value and directs users back to the landing page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N9OC_Vep0HxUgiFpCudsHQ.jpeg" /></figure><p><strong>Step 4: </strong>Finally, I worked on the code to implement the layout of the page above. Below is the GitHub link to the code</p><p><a href="https://github.com/StuternHousemanship/DELIVERYCOG-Frontend-Project-Team1.1/blob/DYC-1_Onboarding_Features/src/pages/dashboard.js">DELIVERYCOG-Frontend-Project-Team1.1/dashboard.js at DYC-1_Onboarding_Features · StuternHousemanship/DELIVERYCOG-Frontend-Project-Team1.1 · GitHub</a></p><h4>Task 4: Implement layout and functionality for the onboarding page</h4><p><strong>Step 1: </strong>Create a file in the pages folder inside the src folder and name it <strong>“onboardingPage.js”</strong></p><p><strong>Step 2: </strong>Create a react functional component and write the code for the layout inside the above file that was created.</p><p><strong>Step 3: </strong>Create a <strong>URL</strong> for the “onboardingPage.js file” inside url.js component.</p><pre>onboardingPage: &quot;/onboarding-page&quot;,</pre><p><strong>Step 4: </strong>Create a <strong>router</strong> for the “onboardingPage.js file” inside the router.js file. Also, import the “onboardingPage.js file” into the router.js file.</p><pre>&lt;Route path={AuthRoutes.onboardingPage} element={&lt;OnboardingPage /&gt;} /&gt;<br>import onboardingPage from &quot;./pages/onboardingPage&quot;;</pre><p><strong>Step 5: </strong>In the onboardingPage.js file,<strong> route </strong>to the addTrip and requestDelivery pages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WoboKqkEPrPg2hrc9eK4Ow.jpeg" /></figure><p><strong>Step 6: </strong>Finally, I worked on the code to implement the layout of the page above. Below is the GitHub link to the code</p><p><a href="https://github.com/StuternHousemanship/DELIVERYCOG-Frontend-Project-Team1.1/blob/DYC-1_Onboarding_Features/src/pages/emailVerificationPage.js">DELIVERYCOG-Frontend-Project-Team1.1/emailVerificationPage.js at DYC-1_Onboarding_Features · StuternHousemanship/DELIVERYCOG-Frontend-Project-Team1.1 · GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=889b52e6edc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>