<?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: JARVUC</title>
    <description>The latest articles on DEV Community by JARVUC (@kojiadrianojr).</description>
    <link>https://dev.to/kojiadrianojr</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%2F242463%2Fb5030b12-ab47-45c1-9d46-7ab6e3941a1c.jpeg</url>
      <title>DEV Community: JARVUC</title>
      <link>https://dev.to/kojiadrianojr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kojiadrianojr"/>
    <language>en</language>
    <item>
      <title>Going back to your roots</title>
      <dc:creator>JARVUC</dc:creator>
      <pubDate>Fri, 13 Nov 2020 02:52:42 +0000</pubDate>
      <link>https://dev.to/kojiadrianojr/going-back-to-your-roots-2ab9</link>
      <guid>https://dev.to/kojiadrianojr/going-back-to-your-roots-2ab9</guid>
      <description>&lt;h1&gt;
  
  
  Let's get started!
&lt;/h1&gt;

&lt;p&gt;It's 2020 and you just lost your job due to the pandemic. You had your hopes up to find a new job but nothings coming. You start doubting yourself and asking what's wrong. &lt;/p&gt;

&lt;p&gt;Guess what, You are not the problem! We are in crisis and we have our own ways to deal with it. &lt;/p&gt;

&lt;p&gt;The majority of us is loved developing using frameworks, like React, Angular, etc right? ( I don't want to speak for everyone but personally I love using frameworks!) &lt;/p&gt;

&lt;h1&gt;
  
  
  Here's My Story
&lt;/h1&gt;

&lt;p&gt;One casual and random day, my girlfriend found this awesome online course and she said, "Hey, what if you focus on honing your skills?" and she sent me the link. &lt;br&gt;
I enrolled with &lt;strong&gt;CS50's Web Programming with Python and JavaScript&lt;/strong&gt; and try to learn and improve my skills. &lt;/p&gt;

&lt;p&gt;While taking the early part of the course, (I just started hehe). I realized that there's still so much to learn in HTML, CSS, and Javascript! So much to review about and hey, I started using SASS! &lt;/p&gt;

&lt;p&gt;Took time to understand deeper on bootstrap and how to write cleaner code and minimal lines! &lt;/p&gt;
&lt;h1&gt;
  
  
  Things I Learned (So far!)
&lt;/h1&gt;
&lt;h4&gt;
  
  
  1. How to use Grid and FlexBox properly
&lt;/h4&gt;

&lt;p&gt;Some people would say, "It's easy!" or "What a basic!". Okay and this is not for you, I guess. &lt;/p&gt;

&lt;p&gt;There's this layout that you really want to follow. &lt;br&gt;
Ask yourself:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;one-dimensional ~ row OR columns? &lt;/p&gt;

&lt;p&gt;multi-dimensional ~ row AND columns? &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once you figured that out, everything comes smoothly. &lt;br&gt;
and also, you can use both FlexBox and Grid and even nest them if you want to!&lt;/p&gt;
&lt;h4&gt;
  
  
  2. Selecting Selectors in CSS!
&lt;/h4&gt;

&lt;p&gt;There are 5 categories to select that element you want to modify!&lt;/p&gt;
&lt;h5&gt;
  
  
  Simple Selectors
&lt;/h5&gt;

&lt;p&gt;These are the class, id, or element name! It is the common selector that everyone use to style, the element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="o"&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="nt"&gt;Universal&lt;/span&gt; &lt;span class="nt"&gt;Selector&lt;/span&gt; 
&lt;span class="nt"&gt;div&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="nt"&gt;element&lt;/span&gt; &lt;span class="nt"&gt;name&lt;/span&gt; 
&lt;span class="nc"&gt;.class&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="nt"&gt;class&lt;/span&gt; 
&lt;span class="nf"&gt;#id&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="nt"&gt;id&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Combinator Selectors
&lt;/h5&gt;

&lt;p&gt;This is a way to make use of the relationship between the selectors. There are 4 combinators you can utilize in css.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;General Sibling Selector (~)&lt;/li&gt;
&lt;li&gt;child selector (&amp;gt;)&lt;/li&gt;
&lt;li&gt;adjacent sibling selector (+)&lt;/li&gt;
&lt;li&gt;descendant selector (space)&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  General Sibling Selector ( ~ )
&lt;/h6&gt;

&lt;p&gt;If you want to select the sibling element of one certain element, you can use this selector. &lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt; &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will select the p tag as long as it's a sibbling of the div tag. &lt;br&gt;
Take note that this will not select the div tag's children. &lt;/p&gt;
&lt;h6&gt;
  
  
  Child Selector ( &amp;gt; )
&lt;/h6&gt;

&lt;p&gt;Do you want to select the child element of a certain element? You can use the child selector!&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will select the h1 that's a child of the div. That's pretty straightforward. &lt;/p&gt;

&lt;h6&gt;
  
  
  Adjacent Sibling Selector ( + )
&lt;/h6&gt;

&lt;p&gt;To understand this, we first need to know the meaning of adjacent. Adjacent means "next to or adjoining something else."&lt;/p&gt;

&lt;p&gt;With that, using the adjacent sibling selector will find the sibbling element that's immediately following.&lt;/p&gt;

&lt;p&gt;To understand better here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The CSS snippets will find the p that's immediately following or next to div. They must have the same parent.&lt;/p&gt;

&lt;h6&gt;
  
  
  Descendant Selector
&lt;/h6&gt;

&lt;p&gt;This selector will find the descendant of a specified element.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="nt"&gt;span&lt;/span&gt; &lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The snippet will find and select all the h1 inside the span inside the div.&lt;/p&gt;

&lt;h5&gt;
  
  
  Pseudo-Classes
&lt;/h5&gt;

&lt;p&gt;A pseudo-class is added to a selector that specified a state of the element. A common example is :hover. When a mouse pointer hovers on a element, a certain style will be applied. &lt;/p&gt;

&lt;p&gt;Example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The button's color will change to red when a mouse hovers it. &lt;/p&gt;

&lt;h5&gt;
  
  
  Pseudo-Elements
&lt;/h5&gt;

&lt;p&gt;A pseudo-element is used to style a specific part(s) of an element. &lt;br&gt;
For starters, it can be used to style the first letter or line of an element, or if you want to add content before or after an element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;::before&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;"check this out"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; Coding Tips! &lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The content "check this out" will be added before the "Coding Tips!" How fun is that! &lt;/p&gt;

&lt;p&gt;If you want to style the first letter? you can do something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="nd"&gt;::first-letter&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will change the first letter of the h1 to the color red.&lt;/p&gt;

&lt;h5&gt;
  
  
  Attribute Selectors
&lt;/h5&gt;

&lt;p&gt;There's a nice way to select a specific element with a specific attribute, and yes it is possible!&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"submit"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will select the button with an attribute type="submit"&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Sass: Syntactically Awesome Style Sheets
&lt;/h4&gt;

&lt;p&gt;Sass made my css style very "sassy", &lt;/p&gt;

&lt;h6&gt;
  
  
  What is SASS?
&lt;/h6&gt;

&lt;p&gt;Well, according to sass-lang.com, It is the most stable, and powerful grade css extension language in the world. &lt;/p&gt;

&lt;p&gt;It's very fun and easy to use! You can install it using node and viola! You can play around and use it in your projects. There many ways to utilize sass.&lt;/p&gt;

&lt;p&gt;You can check their site and documentation to learn!&lt;/p&gt;

&lt;h3&gt;
  
  
  SO FAR ...
&lt;/h3&gt;

&lt;h3&gt;
  
  
  before advancing,
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Make sure you are familiars with your roots, and other get to know the basic language, tools and etc... This will make your life as a coder much easier, and you will understand advance tools and technologies like a cakewalk.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;That's all and what do you want to know next? I'm open for a conversation of you guys want to discuss or add your "roots" before advancing to the next level.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>html</category>
      <category>css</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Should we ditch Redux for Context Hook?</title>
      <dc:creator>JARVUC</dc:creator>
      <pubDate>Wed, 18 Dec 2019 09:37:05 +0000</pubDate>
      <link>https://dev.to/kojiadrianojr/should-we-ditch-redux-for-context-hook-30fl</link>
      <guid>https://dev.to/kojiadrianojr/should-we-ditch-redux-for-context-hook-30fl</guid>
      <description>&lt;h3&gt;
  
  
  Is context gonna end Redux's career?
&lt;/h3&gt;

&lt;p&gt;With the React Hooks, problems are being solve! To use the hooks, we need to develop our app using functional components. We don't need to install additional package just to handle global states.&lt;/p&gt;

&lt;p&gt;Example of functional component&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;app&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;()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;But is the Context hook enough to bury the Redux for good in the near future? &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What would be the advantage of Redux and Context? &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It would be awesome if we could discuss it here. Opinions are welcome! &lt;/p&gt;

</description>
      <category>discuss</category>
      <category>react</category>
      <category>redux</category>
      <category>javascript</category>
    </item>
    <item>
      <title>I prefer Reducer hook over State hook, here's why</title>
      <dc:creator>JARVUC</dc:creator>
      <pubDate>Wed, 18 Dec 2019 02:34:54 +0000</pubDate>
      <link>https://dev.to/kojiadrianojr/i-prefer-reducer-hook-over-state-hook-here-s-why-3af2</link>
      <guid>https://dev.to/kojiadrianojr/i-prefer-reducer-hook-over-state-hook-here-s-why-3af2</guid>
      <description>&lt;p&gt;I've been using State for most of my projects, even created a reusable State method. The State Hook is one of the few basic react hooks that both new react developers (including myself) and veterans uses. &lt;/p&gt;

&lt;h3&gt;
  
  
  Let's have recap
&lt;/h3&gt;

&lt;p&gt;If you're not familiar with what I'm talking about, here's what the State hook looks like in code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&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="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="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&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="dl"&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;()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Recently, I bumped into Reducer Hook while exploring the wonders of react. It is an alternative for the State Hook. If you're familiar with redux, it is the inspiration for the Reducer Hook. &lt;/p&gt;

&lt;h3&gt;
  
  
  What is the Reducer Hook?
&lt;/h3&gt;

&lt;p&gt;The Reducer hook accepts a (state, action) and returns a new state paired with a dispatch. &lt;/p&gt;

&lt;p&gt;Here's how it goes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//the initial state to be passed into the Reducer&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;initialState&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;

&lt;span class="c1"&gt;//The reducer function&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;reducer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
  &lt;span class="k"&gt;switch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;SAY_HELLO&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
     &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;HELLO&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;SAY_HI&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
     &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;HI&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
     &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;default&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;//main app&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;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dispatch&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useReducer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;reducer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;initialState&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;I'm getting off topic, this post is about the reasons why Reducer hook over State hook. &lt;/p&gt;

&lt;h3&gt;
  
  
  WHY I LOVE THE REDUCER HOOK
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The Reducer hook can manage complex state shapes like objects or arrays.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dispatch&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useReducer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;reducer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;users&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Naruto&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;village&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;leaf&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Plus all the logic is in one reducer. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It's pure function! So it doesn't depends on react. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This hook can be easily managed and to organize, and looks soooooooo damn good, well at least in my opinion&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It's easier to test. As I said earlier, It is a pure function. This means this hook doesn't depend on react.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Well I'm not suppose to give my opinion, but give the Reducer Hook a try.
&lt;/h3&gt;

&lt;p&gt;But don't worry State hooks, there's no reason to ditch you and I still appreciate you being here. &lt;/p&gt;

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