<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gabriel Neto</title>
    <description>The latest articles on DEV Community by Gabriel Neto (@gabrieldneto).</description>
    <link>https://dev.to/gabrieldneto</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F893918%2F033a9866-cc89-42b5-9938-8d6cd10b07ef.jpeg</url>
      <title>DEV Community: Gabriel Neto</title>
      <link>https://dev.to/gabrieldneto</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gabrieldneto"/>
    <language>en</language>
    <item>
      <title>How to use prevState of React.useState()</title>
      <dc:creator>Gabriel Neto</dc:creator>
      <pubDate>Fri, 29 Jul 2022 19:16:00 +0000</pubDate>
      <link>https://dev.to/gabrieldneto/how-to-use-prevstate-of-reactusestate-lp</link>
      <guid>https://dev.to/gabrieldneto/how-to-use-prevstate-of-reactusestate-lp</guid>
      <description>&lt;h2&gt;
  
  
  What is "prevState"?
&lt;/h2&gt;

&lt;p&gt;The "prevState" as the name already says (Previous State), get the previous state of your useState hook, this can be used when you have an array in initial state and want to inherit the existing values to add some new values, for example.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use?
&lt;/h2&gt;

&lt;p&gt;For this tutorial i created a simple react checkboxes project in &lt;strong&gt;CodeSandbox.io&lt;/strong&gt; to demonstrate, &lt;a href="https://codesandbox.io/s/prevstate-tutorial-d5bzw3"&gt;click here to see&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Basically we have a data mock with an array of objects&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_pvakgBB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e1ow8jcnklzfx43uylco.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_pvakgBB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e1ow8jcnklzfx43uylco.png" alt="Image description" width="583" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After this we have our App component which have a simple useState hook initializing with an empty array&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--flgiO2Kv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9f0cn1g9s9otl2ma2mb2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--flgiO2Kv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9f0cn1g9s9otl2ma2mb2.png" alt="Image description" width="589" height="68"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This state hook basically will store an array with the values which we will select in the checkboxes below, inside the app component.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--elC3BOrF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j68xk6lszph4qd5ox7pu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--elC3BOrF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j68xk6lszph4qd5ox7pu.png" alt="Image description" width="749" height="508"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will render the app component like this:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vQiNPHeC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1435m07a7vhgjyorqyh6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vQiNPHeC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1435m07a7vhgjyorqyh6.png" alt="Image description" width="170" height="129"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Realize that in the checkbox input we have a function called "toggleOption"&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1hfColly--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3y03d9q6ai2b73vchnzl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1hfColly--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3y03d9q6ai2b73vchnzl.png" alt="Image description" width="594" height="147"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This function is responsible to add the item inside our selected state array.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the function
&lt;/h2&gt;

&lt;p&gt;Let's understand deeper this function...&lt;br&gt;
At the App component in input element of our checkboxes, we are using the function passing the name as parameter&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ROM1TaRi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/it510j0hy9p6x5sf0fi8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ROM1TaRi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/it510j0hy9p6x5sf0fi8.png" alt="Image description" width="642" height="151"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's go to the function&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cssIWZc0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/niowd9dvvmkbz9fnpo71.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cssIWZc0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/niowd9dvvmkbz9fnpo71.png" alt="Image description" width="813" height="513"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are just receiving the previous state of our selected state and assigning the new values, we have also a filter wich remove the items that are equals.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing it
&lt;/h2&gt;

&lt;p&gt;To test this i'm using a simple React.useEffect passing our selected state array as dependency.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RYfFn9hz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y3qm6ipaedqsqzebxm9h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RYfFn9hz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y3qm6ipaedqsqzebxm9h.png" alt="Image description" width="344" height="90"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Testing it in CodeSandBox&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IsSW0aDZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f84zvbba1tk734t6ccce.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IsSW0aDZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f84zvbba1tk734t6ccce.png" alt="Image description" width="443" height="654"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Checking Example 1 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_8yWydWI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2q4obcxvu6q272uor0m1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_8yWydWI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2q4obcxvu6q272uor0m1.png" alt="Image description" width="438" height="681"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Checking Example 3 &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v3N2KsAz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3fuuom9s3iyc1a4j88x2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v3N2KsAz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3fuuom9s3iyc1a4j88x2.png" alt="Image description" width="441" height="698"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Unchecking Example 1&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TEvdE-r7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/70g5jaqxrgpsns9nxurg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TEvdE-r7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/70g5jaqxrgpsns9nxurg.png" alt="Image description" width="438" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Done!
&lt;/h2&gt;

&lt;p&gt;Feel free to check out this code in CodeSandBox &lt;a href="https://codesandbox.io/s/prevstate-tutorial-d5bzw3"&gt;clicking here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>react</category>
      <category>usestate</category>
    </item>
    <item>
      <title>React authentication with Context API and React Router v6 (Typescript)</title>
      <dc:creator>Gabriel Neto</dc:creator>
      <pubDate>Mon, 25 Jul 2022 19:58:00 +0000</pubDate>
      <link>https://dev.to/gabrieldneto/react-authentication-with-context-api-and-react-router-v6-typescript-4kn8</link>
      <guid>https://dev.to/gabrieldneto/react-authentication-with-context-api-and-react-router-v6-typescript-4kn8</guid>
      <description>&lt;h2&gt;
  
  
  Creating a new project
&lt;/h2&gt;

&lt;p&gt;Firstly we'll create a new React project with &lt;a href="https://vitejs.dev/" rel="noopener noreferrer"&gt;Vite&lt;/a&gt;, but you can choose the best option for you.&lt;br&gt;
To start a new project we'll use the command below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

#npm
npm create vite@latest my-auth-app --template react-ts

#yarn
yarn create vite my-auth-app --template react-ts


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After this we need to install all dependencies generated by Vite.&lt;br&gt;
To do this we'll run:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

#npm
npm install

#yarn
yarn


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Well, now we have started our project and have all dependencies installed right.&lt;br&gt;
You will have a folder structure like this in your project:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3duu177wyabqsegcjnsg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3duu177wyabqsegcjnsg.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before we start to code we'll delete some files from our project to make it cleaner like this:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4c7tpbdwffypgu17d3cr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4c7tpbdwffypgu17d3cr.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Do not forget to delete all lines of code that depended of this deleted files&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, lets install &lt;strong&gt;react-router-dom&lt;/strong&gt; to create our routes.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

#npm
npm install react-router-dom
npm install @types/react-router-dom -D

#yarn
yarn add react-router-dom
yarn add @types/react-router-dom


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Done! Now we can start coding our components and context.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating our project pages
&lt;/h2&gt;

&lt;p&gt;Basicly in this example we'll need a login page and a homepage that can only be accessed if you are loged in.&lt;/p&gt;

&lt;p&gt;I'll start creating a simple homepage like this:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0vp45fgkz5ugcy7krry9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0vp45fgkz5ugcy7krry9.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And my login page like this:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzu3mktovfw3fgvuisbru.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzu3mktovfw3fgvuisbru.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating our Routes
&lt;/h2&gt;

&lt;p&gt;I started creating our &lt;strong&gt;login&lt;/strong&gt; route like this&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxge7jjrbvfk9q67a9ky3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxge7jjrbvfk9q67a9ky3.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Passing the &lt;strong&gt;Routes&lt;/strong&gt; component inside our &lt;strong&gt;App.tsx&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F30g92ri1vw371r19t3ps.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F30g92ri1vw371r19t3ps.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you run your app you will get this in &lt;strong&gt;/login&lt;/strong&gt; route:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1nct15iv4qxxjm9jc63o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1nct15iv4qxxjm9jc63o.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating context
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9vdsw6k0x9i3r7ogy7q4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9vdsw6k0x9i3r7ogy7q4.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up our Private Routes
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6y4jxl0rk9tpb7csb350.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6y4jxl0rk9tpb7csb350.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Using context inside &lt;strong&gt;Login&lt;/strong&gt; page
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcqxs2bwb3s1i0qleohdw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcqxs2bwb3s1i0qleohdw.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Done! Now when you click on the &lt;strong&gt;Authenticate button&lt;/strong&gt; in Login page you will set up the authenticated state to true and will be redirected to &lt;strong&gt;Homepage&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This simple project can be find out in github:&lt;br&gt;
&lt;a href="https://github.com/GabrielDNeto/React-Authentication-ContextAPI---react-router-dom" rel="noopener noreferrer"&gt;https://github.com/GabrielDNeto/React-Authentication-ContextAPI---react-router-dom&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>react</category>
    </item>
  </channel>
</rss>
