<?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: JRIVERADDIAZ</title>
    <description>The latest articles on DEV Community by JRIVERADDIAZ (@jriveraddiaz).</description>
    <link>https://dev.to/jriveraddiaz</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%2F822175%2F32694805-80be-4fd1-9113-004df069987f.png</url>
      <title>DEV Community: JRIVERADDIAZ</title>
      <link>https://dev.to/jriveraddiaz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jriveraddiaz"/>
    <language>en</language>
    <item>
      <title>Hooks useState &amp; useEffect</title>
      <dc:creator>JRIVERADDIAZ</dc:creator>
      <pubDate>Fri, 10 Mar 2023 06:44:09 +0000</pubDate>
      <link>https://dev.to/jriveraddiaz/hooks-usestate-useeffect-291j</link>
      <guid>https://dev.to/jriveraddiaz/hooks-usestate-useeffect-291j</guid>
      <description>&lt;p&gt;Now is the turn of the react.js hooks means the main functionality of the react.js, sometimes at the beginning of the learning route is a little bit hard to understand cause there is a level of abstraction on those, basically you can learn it, but understanding these are a pre-code container which allows us to make some changes, keep alert for a change on the app, save states on the page, etc.&lt;/p&gt;

&lt;p&gt;The question here is: &lt;br&gt;
what does it make?&lt;br&gt;
how can I use it?&lt;/p&gt;

&lt;p&gt;useState&lt;/p&gt;

&lt;p&gt;This hook allows us to make some changes to the state of the page, I mean you gonna save something on the state (object, number boolean, string, array, etc.)&lt;/p&gt;

&lt;p&gt;the structure is easy to understand :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t7oeKOMB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jnvgf337ogl2zw7jhh78.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t7oeKOMB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jnvgf337ogl2zw7jhh78.png" alt="useState-hook" width="880" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;useEffect &lt;/p&gt;

&lt;p&gt;This hook allows us to handle state and lifecycle methods for a component &lt;/p&gt;

&lt;p&gt;this hooks is a listener of a change that renders the virtual DOM when a change is made, &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Zuuw3yyw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y5kjxur36iyu0e3uwv69.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Zuuw3yyw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y5kjxur36iyu0e3uwv69.png" alt="useEffect-hook" width="880" height="551"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>react</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Redux Basic Configuration and folder &amp; files Mid.</title>
      <dc:creator>JRIVERADDIAZ</dc:creator>
      <pubDate>Fri, 10 Mar 2023 05:03:47 +0000</pubDate>
      <link>https://dev.to/jriveraddiaz/redux-basic-configuration-and-folder-files-mid-48ef</link>
      <guid>https://dev.to/jriveraddiaz/redux-basic-configuration-and-folder-files-mid-48ef</guid>
      <description>&lt;p&gt;Hi fellas , in this text I'll explain the basic redux files and folders admin this files are completely able to be save in to another folder,  if you have a big app or if you're building a big one also this is a nob to mid level text so you'll need to learn the basics cause if not maybe you gonna mix the knowledge and it will be hard and frustrating but let's move on &lt;/p&gt;

&lt;p&gt;first of all the extensions we'll gonna use on this:&lt;/p&gt;

&lt;p&gt;npx create-react-app&lt;br&gt;
npm i react-router-dom@6  install the router v6 dependency&lt;br&gt;
npm i redux&lt;br&gt;
npm i react-redux&lt;br&gt;
npm i redux-devtools-extension&lt;br&gt;
npm i redux-thunk&lt;/p&gt;

&lt;p&gt;once he have a the npx complete and the un-useful files were deleted we need to create a new folder&lt;br&gt;
inside the src folder called store and the file called store.js&lt;/p&gt;

&lt;p&gt;repeating the same process we'll need to build another folder and file called actions, reducers, store &amp;amp; types&lt;/p&gt;

&lt;p&gt;this is the structure, we want to build&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src
├───actions
|      └ actions.js
├───reducers
|      └ reducer.js      
├───store
|      └ store.js
└───types
|     └ types.js
└───App.js
└───index.js

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

&lt;/div&gt;



&lt;p&gt;next we gonna type code and start to save the types as you've the redux use a switch to manage the actions in order to get, update, create or delete the properties on the stored object without mutate it out so instead we have all the logic on the same function let's split out&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
export const types = {

  authLogin: '[auth] auth login',

}

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

&lt;/div&gt;



&lt;p&gt;once we've built it out the next step is open the store.js and just to get in deeper this store will be the truth of all the info we gonna manage on the app &lt;/p&gt;

&lt;p&gt;concepts: like the name explain is the storage of the info that we want to manage  let's gonna think as a bag of objects were gonna be on it and after we gonna request and dispatch&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
import { createStore, compose, applyMiddleware } from "redux";
import thunk from "redux-thunk";

import { rootReducer  } from "../reducers/rootReducers";

const composeEnhancers = (typeof window !== 'undefined' &amp;amp;&amp;amp; window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || compose;

export const store = createStore(
    rootReducer,
    composeEnhancers(
        applyMiddleware(thunk)
    )
)

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

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>react</category>
      <category>redux</category>
    </item>
    <item>
      <title>Provider pattern.</title>
      <dc:creator>JRIVERADDIAZ</dc:creator>
      <pubDate>Fri, 10 Mar 2023 03:51:10 +0000</pubDate>
      <link>https://dev.to/jriveraddiaz/provider-pattern-6j</link>
      <guid>https://dev.to/jriveraddiaz/provider-pattern-6j</guid>
      <description>&lt;p&gt;The provider pattern is one of the most basic patterns that allows understanding the context API on react and use context hook, sometimes is very hard to implement cause is weird if you are a beginner, the basic trouble here is that the props heritage is too hard to maintenance if you are making a UI that have to use the info stored on it, also if some data is needed on all the app we can make it using this pattern that is the main purpose.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eaR71g75--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2f9k81551wbjx0udrxwn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eaR71g75--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2f9k81551wbjx0udrxwn.png" alt="code-example-props" width="880" height="886"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see in this image the props have passed through the children of this component and if this is spread along the app using a component stack will be hard to understand the code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Wsz4oUku--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ldngnwupxy1kb3rks2le.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Wsz4oUku--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ldngnwupxy1kb3rks2le.jpg" alt="props-context-diagram" width="880" height="1212"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this diagram, you'll see the props are passed through the parent down to the children and the context that is on the app sharing the info all around the app.&lt;/p&gt;

&lt;p&gt;The context is just there, you have to call it and the code is clear than using props a plus is that you can mutate the state.&lt;/p&gt;

&lt;p&gt;As you can see on this image we are using the context, that is included on the react.js create react app or create vite &lt;/p&gt;

&lt;p&gt;We have to make create a context wich can be (bollean, objetcs, arrays, numbers, string) that will be propagated all around the app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KS2WKjP3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y13gxut3ualps6n0wi7o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KS2WKjP3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y13gxut3ualps6n0wi7o.png" alt="basic-context-structure" width="880" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We need to use the children, this allow us to wrap the information from the context all around the app, and make the context callable usign the useContext() hook.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ySCFzXaw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/se6uoefzv3w0nzc9rrf0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ySCFzXaw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/se6uoefzv3w0nzc9rrf0.png" alt="context-structure" width="880" height="610"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, this is an example, in a common react.js component.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mJ3rBDfw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xim2t2lncc6u9q5ew2g7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mJ3rBDfw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xim2t2lncc6u9q5ew2g7.png" alt="useContext-usage" width="880" height="484"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How, we are making a request to the global context, using useContext hook.&lt;/p&gt;

&lt;p&gt;This allow us to make it out and get the info stored on it &lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>React.JS components, props &amp; state</title>
      <dc:creator>JRIVERADDIAZ</dc:creator>
      <pubDate>Sun, 05 Mar 2023 03:43:32 +0000</pubDate>
      <link>https://dev.to/jriveraddiaz/reactjs-components-props-state-3nl4</link>
      <guid>https://dev.to/jriveraddiaz/reactjs-components-props-state-3nl4</guid>
      <description>&lt;p&gt;Components, props &amp;amp; states, those three are the basis of react.js, and are on our daily tasks and walk throught us, react devs, align these 3 pieces to make the bread, in this article, we’ll get in deeper until the bone.&lt;/p&gt;

&lt;p&gt;Components &lt;/p&gt;

&lt;p&gt;The components are the pieces of coding that allows to build APP'S, in short without redundancies, the components are the pieces of the puzzle that allow us to make the UI in a shorter time frame, also this is the very esasiest way cause in a vanilla delelopments the code can be confused.&lt;/p&gt;

&lt;p&gt;components are functions that returns pieces of the UI, in a jsx sintax that will be transpileda along with the functionallity, also the components has a life-cicle wich is very easy to understand,the react,js creates a virtual dom that is a copy of the DOM, the DOM three is all those html elements on the app, now the life-cicle steps are:&lt;/p&gt;

&lt;p&gt;-Instantiation: The component is created and initialized with its initial state and properties.&lt;/p&gt;

&lt;p&gt;-Mounting: The component is added to the virtual DOM or real DOM and rendered on the screen.&lt;/p&gt;

&lt;p&gt;-Updating: When the component's state or props change, the component re-renders to reflect the changes.&lt;/p&gt;

&lt;p&gt;-Unmounting: The component is removed from the virtual DOM or real DOM and destroyed.&lt;/p&gt;

&lt;p&gt;keep this on mind please cause some errors can be avided having this info while you're developing an APP.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Fqav--v3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k5zloowzm5uku1dsq3t3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Fqav--v3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k5zloowzm5uku1dsq3t3.png" alt="component-example" width="880" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is an example of a component, that is handling a title it should be called in an app title fragment and also it is the react.js philosophy to make the development and management easy for us.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8FYyCtwV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h9hswhrpdd4gxw7ixfui.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8FYyCtwV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h9hswhrpdd4gxw7ixfui.jpg" alt="layout-example" width="880" height="680"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a layout as you can see, the app is composed by 4 components that allow us to make each of these independet in between, and also we can make each of them share information but we have to take care cause there are some anti-patterns that will cover into another articles.&lt;/p&gt;

&lt;p&gt;Props:&lt;/p&gt;

&lt;p&gt;There is something called PROPS that can be confused with STATE but what is it?, the props are properties wherever it is (booleans, numbers, string even functions, etc.), those props are just properties that cannot be modified cause the root is a static information none as states, props are immutable. &lt;/p&gt;

&lt;p&gt;State:&lt;/p&gt;

&lt;p&gt;The state is a piece in the memory that works as a very small info repo, we can explain it as a box that should have a non-mandatory-typo, but it have should be specified(as an object, string, number, or boolean, etc) this can be muted and modified by other components that manage some info in between them.&lt;/p&gt;

&lt;p&gt;please feel free to reply if any misinformation is found or missing information has to be added or info needs to be modified&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Controlled &amp; Uncontrolled forms</title>
      <dc:creator>JRIVERADDIAZ</dc:creator>
      <pubDate>Tue, 03 May 2022 04:26:23 +0000</pubDate>
      <link>https://dev.to/jriveraddiaz/controller-uncontrolled-forms-26m6</link>
      <guid>https://dev.to/jriveraddiaz/controller-uncontrolled-forms-26m6</guid>
      <description>&lt;p&gt;Controlled and Uncontrolled form inputs React.js&lt;/p&gt;

&lt;p&gt;Hi there!, in this article, we'll learn about the controlled and uncontrolled inputs, wich allow us to manage forms, &lt;br&gt;
this info will help you to choose the best option. &lt;/p&gt;

&lt;p&gt;Basically when somebody asked you, what are controlled and uncontrolled forms?, you would answer, the controlled forms are linked to the state and help to manage live, while it's been modified we can structure the code to sanitize, manipulate,  etc. the input and the uncontrolled are attached to the dom native handling the input before we click on enter or sumbmit the info  on the input, alow us to sanitize, manipulate, etc. before, so lets see -&amp;gt;&lt;/p&gt;

&lt;p&gt;The uncontrolled input handlers:&lt;/p&gt;

&lt;p&gt;the uncontrolled component  indicates that the info will taken by a uncontrolled way, that means we have to catch the data linking the input to the state directly using a useState waiting for the submit in order to make something, so the input state (initial values, changes on the input etc.) are not handled by react just handled by the dom nativelly such as value tag, etc.)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setSearch&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;submit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nf"&gt;setSearch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&amp;lt;&amp;gt;&lt;/span&gt;

    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt; &lt;span class="na"&gt;onSubmit&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;submit&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;

      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'text'&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'search'&lt;/span&gt;
        &lt;span class="na"&gt;autoComplete&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'off '&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; submit &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;-------------------&lt;/span&gt; &lt;span class="nx"&gt;Example&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-------------------&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setSearch&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;submitTwo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nf"&gt;setSearch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&amp;lt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;

      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; 
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'text'&lt;/span&gt;  
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'search'&lt;/span&gt; 
        &lt;span class="na"&gt;autoComplete&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;' off '&lt;/span&gt; 
        &lt;span class="na"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;submitTwo&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; submit &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;

  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;as you can see the input uncontrolled catch the info at the moment you clicked on the button it didn't catch out before or during the typing process.&lt;br&gt;
you are able to click on it 'n' times also it means you're able to get the info but it's not dynamic or reactive&lt;/p&gt;

&lt;p&gt;friendly reminder put attention on the onClick event and onSubmit that's the key &lt;/p&gt;

&lt;p&gt;why uncontrolled?? it means the info will be catched once we submit and call the handler, it's less dynamic and we are not able to sanitize while we are typing, and we'll need to sanitize every info on an input filed but in this uncontroled,  it's posible but just when we request it out , it is not wrong or bad it's just uncontrolled , it doesn't mean is wrong or something bad it is uncontrolled and has it's own benefits.&lt;/p&gt;

&lt;p&gt;The controlled input handlers:&lt;/p&gt;

&lt;p&gt;the controlled form handle inputs means to a handle way by react (initialvalue, changes on the input etc.) wich allows to get each piece of data since it been filled, it's so helpful cause along with a format data function it can be formatted while the info is adding to the input also your able to apply the functionality you wants imagination is the limit&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setSearch&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;submitOne&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="nf"&gt;setSearch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sentInfo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&amp;lt;&amp;gt;&lt;/span&gt;

    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt; &lt;span class="na"&gt;onSubmit&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;sentInfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;

      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'text'&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'search'&lt;/span&gt;
        &lt;span class="na"&gt;autoComplete&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'off'&lt;/span&gt;
        &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="na"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;submitOne&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; submit &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;

  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;friendly reminder the value it's important in order to complete this controlled input format &lt;/p&gt;

&lt;p&gt;this value on the input will take each typed piece of info and along with a external matching function will help to check each character in order to get just the required onces &lt;/p&gt;

&lt;p&gt;also like this doc shows each once is correct and useful just choose what's the best option, in regards the project you're working with so smile and keep coding.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
