<?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: Fọlájọmí</title>
    <description>The latest articles on DEV Community by Fọlájọmí (@folajomi__).</description>
    <link>https://dev.to/folajomi__</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%2F245762%2F9e15164a-1296-4f80-8a7e-09cb9759ff59.jpg</url>
      <title>DEV Community: Fọlájọmí</title>
      <link>https://dev.to/folajomi__</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/folajomi__"/>
    <language>en</language>
    <item>
      <title>Props and Conditional Rendering</title>
      <dc:creator>Fọlájọmí</dc:creator>
      <pubDate>Tue, 03 Dec 2019 10:56:59 +0000</pubDate>
      <link>https://dev.to/folajomi__/props-and-conditional-rendering-46b0</link>
      <guid>https://dev.to/folajomi__/props-and-conditional-rendering-46b0</guid>
      <description>&lt;p&gt;React allows us to build dynamic web applications which facilitates interaction between the app and users. In order to achieve this, different react components need to interact with each other to properly display app responsiveness to user interactions. This is achieved by the ability of react components to pass data to one another and re-render them based on changes to these data. In this article, we are going to learn about how to pass data from one component to another using &lt;em&gt;Props&lt;/em&gt;. &lt;/p&gt;

&lt;h3&gt;
  
  
  Data Flow in React
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;The flow of data in a react application is unidirectional  and flows from top to bottom on the component tree.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To understand this concept better, lets take a look at the picture of our todo app below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vpp2hg_n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/iifsne9t8daryjb30yqt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vpp2hg_n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/iifsne9t8daryjb30yqt.png" alt="todo application highlighting all its components"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the app above, we indicate the different components in coloured boxes/rectangles. The unidirectional data flow concept simply means that data can only be passed from the parent to the child component and not the other way round. For example, in the todo app, data cannot be passed from the TodoList component (blue square) to the entire application's state, rather the application passes data to the TodoList component.&lt;/p&gt;

&lt;p&gt;I know this might be a lot to take in, but this is the TL;DR version:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Data can only be passed from a parent component to a child component.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now let's talk about how data is passed from the parent to the child.&lt;/p&gt;

&lt;h3&gt;
  
  
  Props
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Props are basically arguments to our react components that allows us to pass data from one component to another on the component tree.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Props are passed from the parent to the child as follows:&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;// In the parent component&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ChildComponent&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This data can be accessed in ChildComponent via the props like so:&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;// ChildComponent&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ChildComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&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;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//returns the data passed from the parent component&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the case of our todo app, we write the following in our text editor&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;const&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;=&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="nx"&gt;todos&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;install react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;create-react-app&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;App&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Todos&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;TodoList&lt;/span&gt; &lt;span class="nx"&gt;todos&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;todos&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&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;TodoList&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&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="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&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;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;todos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;todo&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;todos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;todo&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;todo&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;)
&lt;/span&gt;      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;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;In the code above the App component is the parent which defines the data and passes it down to the TodoList component. This data is then accessed in the TodoList component via props.&lt;/p&gt;

&lt;p&gt;Now we can see a list of our todos&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2_wN9UFX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1575370433077/248KO5j5m.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2_wN9UFX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1575370433077/248KO5j5m.jpeg" alt="Sbx1.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conditional Rendering
&lt;/h3&gt;

&lt;p&gt;Now we have an (ugly) app that displays all our todos (as a list) :), but it renders a list of hard-coded todo. What happens if we delete all the dummy data in the todos array, leaving only an empty list? Excluding the Todo h1 element, we get a blank page that offers nothing to the user on what to do. We do not want our users staring at a blank page if they have not added a todo yet. Rather we want to display an instruction on how they can add a todo and remove this instruction once they have added one todo. This is a perfect job for an if statement, right? This operation is simply what Conditional Rendering is.&lt;/p&gt;

&lt;p&gt;In react, conditional rendering is done the same we use conditionals in JavaScript using the if statement or the ternary operator ( ? : ). This is because...&lt;strong&gt;Drumroll&lt;/strong&gt;... REACT is JS.&lt;/p&gt;

&lt;p&gt;Let's see how we can solve our todo problem 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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;TodoList&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&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="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;todos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&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;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;todos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;todo&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;todos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;todo&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;todo&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;)
&lt;/span&gt;        &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&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;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h3&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;No&lt;/span&gt; &lt;span class="nx"&gt;todo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;yet&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Use&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;form&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;create&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;todos&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h3&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This can also be done using the ternary operator&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const TodoList = (props) =&amp;gt; {

  return props.todos.length?
    &amp;lt;ul&amp;gt;
      {
        props.todos.map(todo =&amp;gt; &amp;lt;li key={props.todos.indexOf(todo)}&amp;gt;{todo}&amp;lt;/li&amp;gt;)
      }
    &amp;lt;/ul&amp;gt;
  : &amp;lt;h3&amp;gt;No todo(s) yet, Use the form to create new todos&amp;lt;/h3&amp;gt;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If either of the TodoList Components above is used, we still get the same result shown in the image above. However, if we delete all the todos in our list, leaving only an empty array, we get this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I8IVYap0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1575549845230/eqy9phqsl.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I8IVYap0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1575549845230/eqy9phqsl.jpeg" alt="Todo5.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, when we add todos, the instruction disappears and gives way for our todo items. We'll look at how to add todos in our app later.&lt;/p&gt;

&lt;p&gt;You can also edit the code and experiment on the code in &lt;a href="https://codesandbox.io/s/planned-rms6l"&gt;this sandbox&lt;/a&gt;&lt;br&gt;
You can also read more about &lt;a href="https://reactjs.org/docs/components-and-props.html"&gt;props&lt;/a&gt; and &lt;a href="https://reactjs.org/docs/conditional-rendering.html"&gt;conditonal&lt;/a&gt; rendering in the React docs.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Please leave comments if you find any part of this post confusing or error or typos.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Building React Components II: Class Components</title>
      <dc:creator>Fọlájọmí</dc:creator>
      <pubDate>Mon, 02 Dec 2019 12:13:54 +0000</pubDate>
      <link>https://dev.to/folajomi__/building-react-components-ii-class-components-94p</link>
      <guid>https://dev.to/folajomi__/building-react-components-ii-class-components-94p</guid>
      <description>&lt;p&gt;In the &lt;a href="https://jormee.hashnode.dev/building-react-components-i-functional-components-ck3dm7mac00uno4s16y73oc3l"&gt;previous blog post&lt;/a&gt;, we said react components are of two types, and we talked about functional components.&lt;/p&gt;

&lt;p&gt;This blog post will focus on the other type of react components - &lt;em&gt;class components&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What are class components?
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Class components are react components that are defined using ES6 classes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We can create simple components (and complex ones too) using classes, by simply defining them in an ES6 class, as follows:&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;class&lt;/span&gt; &lt;span class="nx"&gt;Hi&lt;/span&gt; &lt;span class="kd"&gt;extends&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;Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;render&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;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Welcome&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="nx"&gt;BookStore&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&amp;gt;&lt;/span&gt;&lt;span class="err"&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;This is the simplest form of a class component, and should return an &lt;code&gt;h1&lt;/code&gt; saying "Welcome to the React BookStore". Everything in this component is very similar to our functional component except the &lt;code&gt;render()&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;The render method is used to render DOM nodes and  is the only required* method in the class component. The class component may also contain other built-in methods called &lt;em&gt;Lifecycle Methods&lt;/em&gt;, however these are optional. We will take a look at some important lifecycle methods in details later. First we look at State.&lt;/p&gt;

&lt;h3&gt;
  
  
  State
&lt;/h3&gt;

&lt;p&gt;The class component gives us access to state, which functional components did not (until the introduction of hooks in react 16.8). The state property of a component helps us track the  state of our components and enables us make appropriate changes to the application based on its state.&lt;/p&gt;

&lt;p&gt;To use state in our react application, we define the property within the constructor function of our component class.&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;class&lt;/span&gt; &lt;span class="nx"&gt;BookStore&lt;/span&gt; &lt;span class="kd"&gt;extends&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;Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;bookId&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="na"&gt;books&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
            &lt;span class="na"&gt;bookDetails&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="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;render&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Welcome&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="nx"&gt;BookStore&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;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;blockquote&gt;
&lt;p&gt;Note that the constructor function is also a &lt;em&gt;Lifecycle method&lt;/em&gt; and should only be used when initializing state or binding methods. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When using the constructor function, the &lt;code&gt;super(props)&lt;/code&gt; should be called, else &lt;code&gt;this.props&lt;/code&gt; will return undefined and may cause bugs in the app.&lt;/p&gt;

&lt;h4&gt;
  
  
  setState
&lt;/h4&gt;

&lt;p&gt;This is a function that allows us to update the state of a react application. It is bad practice to reassign or edit the state of your app directly and this may cause bugs/inconsistencies in your app.&lt;br&gt;
To update the state of a component, we call setState as follows:&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;this&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="na"&gt;bookId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;123&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is also important to avoid carrying out destructive operations (i.e. operations that directly mutate the state) such as &lt;code&gt;splice()&lt;/code&gt; on the state object.&lt;/p&gt;

&lt;h3&gt;
  
  
  What are Lifecycle Methods
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;React Lifecycle methods are basically functions that we want to run at specific times in the life of our applications.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The following are some of the most important lifecycle methods react gives us access to:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. componentDidMount Method
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;componentDidMount&lt;/code&gt; method defines a function that we want to run when the component first mounts (i.e. the first time the component is rendered on the DOM). Let's say we want to fetch a list of books from our books database, we would like to define the function in the componentDidMount method, which fetches the required data once the component is mounted on the DOM.&lt;br&gt;
In code, a call to fetch a list of pictures for our books would look like this:&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;class&lt;/span&gt; &lt;span class="nx"&gt;BookStore&lt;/span&gt; &lt;span class="kd"&gt;extends&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;Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;bookId&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="na"&gt;books&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
            &lt;span class="na"&gt;bookDetails&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="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;componentDidMount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://bookdatabase.com/photos&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="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
               &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;this&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="na"&gt;books&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;]}))&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="nx"&gt;render&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Welcome&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="nx"&gt;BookStore&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;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;This fetches all the pictures we need once the component mounts (renders for the first time)&lt;/p&gt;

&lt;h4&gt;
  
  
  2. componentDidUpdate Method
&lt;/h4&gt;

&lt;p&gt;This method is called when a component's state changes, i.e. the component has changed based on user input/interaction with the app. It takes the prevState(previous state) and/or prevProps(previous props) as arguments and runs makes appropriate changes to the DOM.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It is important to note that you must use a conditional statement to setState within the componentDidUpdate method, else you will create an infinite loop.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This method can be used to make changes to the DOM to reflect user-input. For example, if you want to get details about a book that  a user selects. In code, this would look like:&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;class&lt;/span&gt; &lt;span class="nx"&gt;BookStore&lt;/span&gt; &lt;span class="kd"&gt;extends&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;Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;bookId&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="na"&gt;books&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
            &lt;span class="na"&gt;bookDetails&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="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;componentDidMount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://bookdatabase.com/photos&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="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
               &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;this&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="na"&gt;books&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;]}))&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;componentDidUpdate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prevState&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&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;bookId&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;prevState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bookId&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`https://bookdatabase.com/books/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&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;bookId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
                &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;this&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="na"&gt;bookDetails&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;details&lt;/span&gt;&lt;span class="p"&gt;}))&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
     &lt;span class="nx"&gt;render&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Welcome&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="nx"&gt;BookStore&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;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;This code sets the book details to the details gotten from the network request only if there has been a change in the bookId. This is to ensure that no request is made when there is no change in the bookId which will cause an infinite loop.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. componentWillUnmount Method
&lt;/h4&gt;

&lt;p&gt;The componentWillUnmount method is called when before a component is removed from the DOM. It is used to perform cleanups in our app, such as canceling network requests or subscriptions to services.&lt;/p&gt;

&lt;p&gt;You can get more information about React Lifecycle methods in the &lt;a href="(https://reactjs.org/docs/react-component.html)"&gt;React docs&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Building React Components I: Functional Components</title>
      <dc:creator>Fọlájọmí</dc:creator>
      <pubDate>Sun, 24 Nov 2019 23:06:35 +0000</pubDate>
      <link>https://dev.to/folajomi__/building-react-components-i-functional-components-3di4</link>
      <guid>https://dev.to/folajomi__/building-react-components-i-functional-components-3di4</guid>
      <description>&lt;p&gt;Now that our react application is all set up, we can now start building components for our web page!!! &lt;/p&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%2Fuoxaqnbcpy92ntezsrop.gif" 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%2Fuoxaqnbcpy92ntezsrop.gif" alt="yay"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We all know what react components are. If we don't or we've forgotten, let's have a little refresher in &lt;a href="https://jormee.hashnode.dev/react-an-introduction-ck20hsam1001bnys1uakvgop7" rel="noopener noreferrer"&gt;this blog post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;React components are of two types:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Functional Components&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Class Components&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We would be covering functional components in this post.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Are Functional Components?
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Fuctional components are the basic building blocks of React, they are the simplest components that can be created in react&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;How simple are they, really?&lt;/p&gt;

&lt;p&gt;Functional  components are basically, JavaScript functions. They accept a single props (short for properties) argument and returns React elements. Let's take a look at how they really work:&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Hello&lt;/span&gt; &lt;span class="o"&gt;=&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="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Hello React&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As little as it is, the piece of code above is a valid react component which renders "Hello React" to the screen. However, this is not the full picture.&lt;/p&gt;

&lt;p&gt;To get the full picture, lets create a new react app called bookstore by running&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-react-app bookstore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in the terminal and &lt;code&gt;cd&lt;/code&gt; into the created bookstore project file at the end of the &lt;code&gt;create-react-app&lt;/code&gt; process, then run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to start our development server.&lt;/p&gt;

&lt;p&gt;In our code editor, let's edit the App.js file, located in the src folder. Let's change the code so we have:&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="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="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"App"&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;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Welcome to the ReactJS Bookstore&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&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;It's nice to have you here&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;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&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;Let's go over our code one line at a time,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Line 1: The first line imports the React component from the react library, which gives us the ability to write JSX in our code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lines 3-10 define the function which returns our JSX. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;It is very important to understand the naming convention for our react components. When creating a new react component, it is important to start our component name with an uppercase letter. This will be explained in detail along the line.&lt;/p&gt;

&lt;p&gt;Notice that we wrap our JSX in a div tag, this is because react functions can only return one component, therefore it does not support having adjacent elements without them being wrapped by another element. This way, the function only returns the &lt;code&gt;div&lt;/code&gt; element&lt;/p&gt;

&lt;p&gt;Also, notice the &lt;code&gt;className&lt;/code&gt; attribute on the div tag in line 5. This is the JSX equivalent of the html &lt;code&gt;class&lt;/code&gt; attribute. This is written like this because class is a reserved keyword in JavaScript and since our react app is a JavaScript file, we cannot use the class keyword, hence the className attribute. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;The last line (10) in our little code exports the App component we created so it can be used in another file. Remember that our App.js file is actually imported and rendered in the index.js file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The code above returns the following:&lt;/p&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1574545106015%2F5GjbLVEz4.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1574545106015%2F5GjbLVEz4.png" alt="welcome to our the react bookstore landing page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we may be thinking, why go through all these hassle when I can actually recreate all we've done in pure html?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/3o7TKBjqwOlQYMirle/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/3o7TKBjqwOlQYMirle/giphy.gif" alt="be patient"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll appreciate react more when we cover rendering dynamic components. When? NOW!!!&lt;/p&gt;

&lt;h3&gt;
  
  
  Rendering Dynamic Components
&lt;/h3&gt;

&lt;p&gt;Now let's add a list of books we have in our bookstore to the page. How do we do these?&lt;br&gt;
We could manually create a list and hard code all of the books in our store database into the JSX (and it would work). However, what happens if we have like 10,000 different books in our database, then we would type out &lt;code&gt;&amp;lt;li&amp;gt;bookname&amp;lt;/li&amp;gt;&lt;/code&gt; 10,000 times? Not efficient.&lt;/p&gt;

&lt;p&gt;What we should do as developers is find a way to loop over the contents of the database and dynamically render each book in the database on our page, right? Luckily for us, react is JavaScript and JavaScript (ES6) provides the &lt;code&gt;map&lt;/code&gt; function for us.&lt;/p&gt;

&lt;p&gt;Let's do this in code:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/3o72F03RnbPTvKtR7y/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/3o72F03RnbPTvKtR7y/giphy.gif" alt="let's do this"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First, lets add the following array to our code to imitate our database. We could put it anywhere before the return statement, so let's put it on line 5, just before the return statement.&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;const&lt;/span&gt; &lt;span class="nx"&gt;books&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Odd Thomas&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Harry Potter&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;The DaVinci Code&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;The Lost Symbol&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Forever Odd&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Angels and Demons&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we have six books in our database that we want to render in our react app. To do this, we will add the following code to line 11 of our 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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&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;books&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;book&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;books&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;book&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;book&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;)
&lt;/span&gt;    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's go over the code:&lt;/p&gt;

&lt;p&gt;The first line opens up a &lt;code&gt;ul&lt;/code&gt; tag which indicates that an unordered list is coming next. The curly braces on the second line is to signify to react that what comes next is JavaScript i.e. if you want to write JavaScript code in the middle of JSX, it should be wrapped in curly braces.&lt;/p&gt;

&lt;p&gt;The main code is written on the third line and it maps over the database and returns an &lt;code&gt;li&lt;/code&gt; element that contains the name of each book in the database.&lt;/p&gt;

&lt;p&gt;You would notice, however, the &lt;code&gt;key&lt;/code&gt; attribute specified on the &lt;code&gt;li&lt;/code&gt; tag. This is a way for react to keep track of all the items/elements in a list so it would know which element is where in case we need to delete or edit a book. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;The key for each element must be unique to the element and should not change. Generally, it is bad practice to use the index of the item as it's key because it may change and lead to inconsistencies in our app. Rather it is better to use an id library such as &lt;strong&gt;&lt;a href="https://www.npmjs.com/package/uuid" rel="noopener noreferrer"&gt;uuid&lt;/a&gt;&lt;/strong&gt; to create unique identifiers for each element in a list.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The code above returns the following:&lt;/p&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1574549649833%2FXZqtbyOKi.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1574549649833%2FXZqtbyOKi.png" alt="React app showing list of books"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have separated the code onto separate lines to make sure that they are visible and easy to understand, but it could all fit in one line and read meaningfully, which would mean that in one line of code, we have extracted all the books in the database and rendered it in our application.&lt;/p&gt;

&lt;p&gt;This was a long one, and I hope we take our times to fully understand the concepts introduced in this page. To further improve our knowledge, here is a &lt;a href="https://reactjs.org/docs/components-and-props.html" rel="noopener noreferrer"&gt;link to the official react documentation on functional components&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We will cover class components in the next blog post.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Walking Through the create-react-app Files</title>
      <dc:creator>Fọlájọmí</dc:creator>
      <pubDate>Sat, 23 Nov 2019 20:03:22 +0000</pubDate>
      <link>https://dev.to/folajomi__/walking-through-the-create-react-app-files-4803</link>
      <guid>https://dev.to/folajomi__/walking-through-the-create-react-app-files-4803</guid>
      <description>&lt;p&gt;Hey guys, &lt;/p&gt;

&lt;p&gt;In the &lt;a href="https://jormee.hashnode.dev/getting-started-ii-create-react-app-ck2owq9uw005loks1usno0wd1" rel="noopener noreferrer"&gt;previous blog post&lt;/a&gt;, we looked at how we can get our react applications started with &lt;code&gt;create-react-app&lt;/code&gt;. This post will walk us through the boilerplate (or template) files created for us by this simple command and how we can use them in building our applications.&lt;/p&gt;

&lt;p&gt;For this post, I have created a new react boilerplate called pomodoro and this is what it looks like at the moment.&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1573142910226%2F2wQPh4t8R.jpeg" 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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1573142910226%2F2wQPh4t8R.jpeg" alt="react-app.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And if we open up our project file in the code editor (I use VS code), here's what we have:&lt;/p&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1574534295672%2FMz4Bu-wAQ.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1574534295672%2FMz4Bu-wAQ.png" alt="boilerplate files for new react-app"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Walkthrough of All Files
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;node_modules/&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This folder contains all libraries and packages required for react to run. They consist of many npm packages and any new package you install for your application is stored in this folder. You would notice that this folder has a slightly faded color. This is VS code letting us know that the file is being ignored.&lt;/p&gt;

&lt;p&gt;Q: &lt;strong&gt;&lt;em&gt;What does this mean and why?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A: By default, node modules are ignored because of their size and because they are not really needed in the git repo and can be recovered easily. All other files that are/should be ignored are those that are not needed for you application to run and sensitive files that contain sensitive information such as API keys, Authentication tokens etc. We'll look at them more deeply at a later time.&lt;/p&gt;

&lt;p&gt;2.&lt;code&gt;public/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This folder contains the &lt;code&gt;favicon.ico&lt;/code&gt; file (which is the small icon file displayed next to the site name in the browser tab), &lt;code&gt;index.html&lt;/code&gt; file (the main html file of the react app), logos files, &lt;code&gt;robots.txt&lt;/code&gt; file. (which tells web crawlers which pages can be requested from your site to avoid overloading your site with requests) and a &lt;code&gt;manifest.json&lt;/code&gt; file, which allows you to specify the behavior of your application when saved on user devices (as PWAs).&lt;/p&gt;

&lt;p&gt;3.&lt;code&gt;src/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Presently contains all boilerplate codes for starting up, styling and testing our react application. This is the folder where we write all our code, and create each component that powers our app.&lt;/p&gt;

&lt;p&gt;4.&lt;code&gt;.gitignore&lt;/code&gt; file&lt;/p&gt;

&lt;p&gt;This file specifies all the files and folders we want git to ignore. The files specified in this file will not be tracked, staged, committed or pushed to the repository because they are not needed for the application to run (e.g. test files) or they contain sensitive information that cannot be exposed (e.g. .env files) or node_modules folder that is too big.&lt;/p&gt;

&lt;p&gt;5.&lt;code&gt;package-lock.json&lt;/code&gt; file&lt;/p&gt;

&lt;p&gt;This is an automatically generated file that should not be tampered with. It contains information that describes the tree that was generated exactly, such that later installs are able to generate identical trees, regardless of intermediate dependency updates.&lt;/p&gt;

&lt;p&gt;6.&lt;code&gt;package.json&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Earlier, I mentioned that the node_modules can be ignored because they can be easily recovered, the package.json file makes this possible.&lt;/p&gt;

&lt;p&gt;This file contains all information about your application such as dependencies (libraries, packages needed for your application to run), dev-dependencies (packages used in building the application, but are not required for it to run such as nodemon), scripts (these defines what is run whenever any of the commands are executed in the terminal. For example, when we run &lt;code&gt;npm start&lt;/code&gt; in the terminal, what really runs is  &lt;code&gt;react-scripts start&lt;/code&gt;)etc.&lt;/p&gt;

&lt;p&gt;If you clone a repository to your machine, it would not come with the node_modules folder, since it was ignored, hence the project will not run on your device until the node modules required are installed. To install the required node modules, enter the following command into the terminal&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;yarn install&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This command will check the package.json file and install all dependencies of the project.&lt;/p&gt;

&lt;p&gt;Now that we are all full acquainted with the react environment, we can now start to learn the building blocks in the next post in  this series.&lt;/p&gt;

&lt;h3&gt;
  
  
  Links
&lt;/h3&gt;

&lt;p&gt;Feel free to visit the following links for further reading on the topics/files we have covered.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.npmjs.com/files/package-lock.json" rel="noopener noreferrer"&gt;package-lock.json&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.npmjs.com/files/package.json" rel="noopener noreferrer"&gt;package.json&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://help.github.com/en/github/using-git/ignoring-files" rel="noopener noreferrer"&gt;.gitignore&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/Manifest" rel="noopener noreferrer"&gt;manifest.json&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://neilpatel.com/blog/robots-txt/" rel="noopener noreferrer"&gt;robots.txt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.npmjs.com/files/folders.html" rel="noopener noreferrer"&gt;node_modules&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>react</category>
      <category>beginners</category>
      <category>package</category>
    </item>
    <item>
      <title>Getting Started II: create-react-app</title>
      <dc:creator>Fọlájọmí</dc:creator>
      <pubDate>Thu, 07 Nov 2019 16:09:38 +0000</pubDate>
      <link>https://dev.to/folajomi__/getting-started-ii-create-react-app-4k4e</link>
      <guid>https://dev.to/folajomi__/getting-started-ii-create-react-app-4k4e</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This article concludes the setting up of react, which began in the &lt;a href="https://jormee.hashnode.dev/getting-started-with-react-ck2axmv2n00py3is1z7od7v4c"&gt;the previous blog post&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the &lt;a href="https://jormee.hashnode.dev/getting-started-with-react-ck2axmv2n00py3is1z7od7v4c"&gt;the previous blog post&lt;/a&gt;, we looked at how we can embed react and react-dom, as scripts, within our html documents, I would recommend for web pages which require very little dynamicity.&lt;/p&gt;

&lt;p&gt;However, depending on the complexity of the dynamic part of your web page, this method may increases the length of our html document and make it difficult (at times overwhelming) to read.&lt;/p&gt;

&lt;h5&gt;
  
  
  Requirements
&lt;/h5&gt;

&lt;blockquote&gt;
&lt;p&gt;Create React App is an officially supported way to create single-page React applications. It offers a modern build setup with no configuration.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It is a very simple way to setup a react application from scratch, and requires that node and npm packages be installed on your device. So, if you have not,  you can download the long term support (LTS) version of &lt;a href="https://nodejs.org/en/"&gt;node here&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;npm comes out-of-the-box with node&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To check if you have node (and npm) installed on your device, open your command line interface (CLI) (i.e. command prompt (Windows) or terminal (Mac)), and type the following after the prompt&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;node &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have node installed, it should return a version number, otherwise it should return an error. (same goes for npm).&lt;/p&gt;

&lt;h4&gt;
  
  
  Creating a react application
&lt;/h4&gt;

&lt;p&gt;Now that we have both installed, let's get started with creating our react application.&lt;br&gt;
To get started, type the following command into your CLI&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; &lt;span class="nv"&gt;$ &lt;/span&gt;npx create-react-app new-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;note that npx is not a typo, it is a package that comes with npm 5.2 and higher. If your npm version is less than 5.2, I would recommend you install an updated version. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;However, you can still create a react app on versions lower than 5.2 by following these two steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In your CLI, type
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; create-react-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and wait for the installation to finish, then&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;type
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;create-react-app new-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;note that &lt;code&gt;new-app&lt;/code&gt; is the name of our application and you can change it to anything you want.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When a new react app has been successfully created (using npx or npm), you should see the following screen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Et49o6T4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1573141373587/Fyzm94Xyr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Et49o6T4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1573141373587/Fyzm94Xyr.png" alt="create-react-app.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and a new folder named new-app inside the current folder. &lt;/p&gt;

&lt;p&gt;To run your react application, you &lt;code&gt;cd&lt;/code&gt; into the new folder created type the following into your CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$npm&lt;/span&gt; start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and allow it to spin up the development server. When the server is up, your default browser should open automatically and you should see something like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3mWXhQjd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1573142910226/2wQPh4t8R.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3mWXhQjd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1573142910226/2wQPh4t8R.jpeg" alt="react-app.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulations, your new application is up and running :).&lt;/p&gt;

</description>
      <category>react</category>
      <category>beginners</category>
      <category>newbie</category>
    </item>
    <item>
      <title>Explain Redux/Context API Like I'm Five</title>
      <dc:creator>Fọlájọmí</dc:creator>
      <pubDate>Sat, 02 Nov 2019 23:36:17 +0000</pubDate>
      <link>https://dev.to/folajomi__/explain-redux-context-api-like-i-m-five-31kc</link>
      <guid>https://dev.to/folajomi__/explain-redux-context-api-like-i-m-five-31kc</guid>
      <description>&lt;p&gt;I want an explanation on how it is better/not to use react context API wit useReducer hook instead of redux&lt;/p&gt;

</description>
      <category>explainlikeimfive</category>
    </item>
    <item>
      <title>Getting Started With React</title>
      <dc:creator>Fọlájọmí</dc:creator>
      <pubDate>Mon, 28 Oct 2019 09:00:00 +0000</pubDate>
      <link>https://dev.to/folajomi__/getting-started-with-react-8b2</link>
      <guid>https://dev.to/folajomi__/getting-started-with-react-8b2</guid>
      <description>&lt;p&gt;This is where we write our first codes in our react track (&lt;em&gt;&lt;strong&gt;kinda&lt;/strong&gt;&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;But before we proceed, it is important that we all have an understanding of the following&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Basic understanding of &lt;strong&gt;HTML and CSS&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Basic Knowledge of &lt;strong&gt;JavaScript (ES6+ syntax and features)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Basic knowledge of the &lt;strong&gt;DOM and DOM manipulation&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;You should also have &lt;strong&gt;Node.js and npm&lt;/strong&gt; installed globally on your computer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you haven't, you can &lt;a href="https://nodejs.org/en/" rel="noopener noreferrer"&gt;download Node.js and npm here&lt;/a&gt;. &lt;em&gt;Make sure you download the latest stable version&lt;/em&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Adding react to a project
&lt;/h4&gt;

&lt;p&gt;There are a few different ways of using the react library for your project(s), depending on why you need react for your webpage.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Recall that react is used to add dynamic content to your web page&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So it follows that, maybe, only a little section (component) of your web page (probably a widget) needs dynamic content.&lt;/p&gt;

&lt;p&gt;The first way to use react in you web application is to embed it in your HTML file like any other javascript library.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
  &amp;lt;html&amp;gt;
    &amp;lt;head&amp;gt;
      &amp;lt;meta charset='UTF-8' /&amp;gt;
      &amp;lt;title&amp;gt;Home!&amp;lt;/title&amp;gt;

      &amp;lt;script src="https://unpkg.com/react@16/umd/react.development.js"&amp;gt;&amp;lt;/script&amp;gt;
      &amp;lt;script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"&amp;gt;&amp;lt;/script&amp;gt;
      &amp;lt;script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;/head&amp;gt;

    &amp;lt;body&amp;gt;
      &amp;lt;div id="root"&amp;gt;&amp;lt;/div&amp;gt;

      &amp;lt;script type="text/babel"&amp;gt;
        // all react codes will be here
      &amp;lt;/script&amp;gt;
    &amp;lt;/body&amp;gt;
  &amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code above is the basic way to get started with react applications. You would notice that the only difference between this and your everyday HTML document is the script tags (&lt;em&gt;of course you have used script tags a lot&lt;/em&gt;), so it's basically no difference.&lt;br&gt;
The script tags are used to load in the libraries needed for react to run:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;React&lt;/strong&gt; - the first script tag imports the react library&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React DOM&lt;/strong&gt; - the second script tag imports react-DOM, which allowas us to use DOM specific methods in our script.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Babel&lt;/strong&gt; - this is a third-party compiler that allows our applications run ES6+ on older browsers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For now, we only focus on the script tag at the bottom of the component where all our react logic would go.&lt;/p&gt;

&lt;p&gt;Within the script tags, input the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script type='text/babel'&amp;gt;
  const Hello = () =&amp;gt; {
    return &amp;lt;h1&amp;gt;Hello World&amp;lt;/h1&amp;gt;
  }

  ReactDOM.render(&amp;lt;Hello /&amp;gt;, document.querySelector('root'));
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code above defines the component Hello like any normal arrow function. However, you would notice the html-like code in the code, but React is a JavaScript framework, right? Well react allows us to write JSX, which is JavaScript and XML, in our code. So the html-like parts of the code are actually XML.&lt;/p&gt;

&lt;p&gt;On the last line, we call the ReactDOM's render function (&lt;em&gt;this comes with the &lt;strong&gt;react-dom&lt;/strong&gt; package we added to our script&lt;/em&gt;) and pass in our component and where we want it to be displayed on the DOM, in this case the root div.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Notice&lt;/strong&gt; that in naming the Hello component, we capitalized the first letter, this is the way to tell react that it is a user-defined component and not a regular html tag.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This is how the whole code should look now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;meta charset="UTF-8"&amp;gt;

  &amp;lt;script src="https://unpkg.com/react@16/umd/react.development.js"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;title&amp;gt;Home!&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;div id="root"&amp;gt;&amp;lt;/div&amp;gt;

  &amp;lt;script type='text/babel'&amp;gt;
    const Hello = () =&amp;gt; {
      return &amp;lt;h1&amp;gt;Hello World!&amp;lt;/h1&amp;gt;
    }

    ReactDOM.render(&amp;lt;Hello /&amp;gt;, document.querySelector('#root'))
  &amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result:&lt;/p&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1572297348533%2Fu6ilZQTg7.jpeg" 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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1572297348533%2Fu6ilZQTg7.jpeg" alt="Hello World rendered by our react application "&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The next post will deal with the second way of using react in our application. &lt;em&gt;This is to ensure that we don't consume too much at a time&lt;/em&gt;.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>javascriptlibrary</category>
      <category>react</category>
    </item>
    <item>
      <title>React: An Introduction</title>
      <dc:creator>Fọlájọmí</dc:creator>
      <pubDate>Mon, 21 Oct 2019 12:51:26 +0000</pubDate>
      <link>https://dev.to/folajomi__/react-an-introduction-35gd</link>
      <guid>https://dev.to/folajomi__/react-an-introduction-35gd</guid>
      <description>&lt;p&gt;&lt;em&gt;&lt;strong&gt;This is the first of a series where we will go from absolute newbies to building functional applications in react.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;React is a JavaScript library for building user interfaces&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;React is a powerful tool for creating dynamic web applications that are super-responsive and is created and maintained by &lt;strong&gt;Facebook&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Thinking in React.
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;In react, separation of concerns is not talking about separating the structure, style and behavior of the application.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Rather it is separating the application into various single-purpose components that come together to for the entire application. So, when building applications using react, you think of the application as a combination of various single-purpose components.&lt;br&gt;
consider the image below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vpp2hg_n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/iifsne9t8daryjb30yqt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vpp2hg_n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/iifsne9t8daryjb30yqt.png" alt="todo application with various components"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The different components of the application are identified with the rectangles. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;It is important to note that the number of components you have in your application depends totally on you&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;However, it makes it easier to make each component responsible for only one action in your application. This helps to detect bugs easily and gives you the option to reuse each component in other areas of the application.&lt;/p&gt;

&lt;p&gt;This post is just to introduce us to the way react allows us to think about our applications. In the next part, we will take a look at how components are created.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>react</category>
    </item>
    <item>
      <title>Things I Don't Know</title>
      <dc:creator>Fọlájọmí</dc:creator>
      <pubDate>Fri, 18 Oct 2019 22:09:36 +0000</pubDate>
      <link>https://dev.to/folajomi__/things-i-don-t-know-43ag</link>
      <guid>https://dev.to/folajomi__/things-i-don-t-know-43ag</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yRvNZozm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://edsurge.imgix.net/uploads/post/image/12376/AWS1-1562626711.jpg%3Fauto%3Dcompress%252Cformat%26w%3D640%26h%3D259%26fit%3Dcrop" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yRvNZozm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://edsurge.imgix.net/uploads/post/image/12376/AWS1-1562626711.jpg%3Fauto%3Dcompress%252Cformat%26w%3D640%26h%3D259%26fit%3Dcrop" alt="AWS1-1562626711.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Taking inspiration from Dan  Abramov's &lt;a href="https://overreacted.io/things-i-dont-know-as-of-2018/"&gt;blog post&lt;/a&gt; on the same topic &lt;strong&gt;back in 2018&lt;/strong&gt;, I am diving into technical writing with a partial list of programming topics I do not know at the time of writing this post.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Why am I doing this?&lt;/em&gt; Simply put, I believe it is very important for a developer at any level to be able to identify technologies that will help in writing better code and be able to publicly admit that (s)he has no idea how to use them.  This is very important for learning.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Empty your cup so that it may be filled; become devoid to gain totality." &lt;strong&gt;~ Bruce Lee&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Okay, enough of introductions, let's dive right into it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Thing's I Don't Know
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Wordpress:&lt;/strong&gt; I know it is used to create websites and manage contents, but that's all I know about it, I don't even know how to set it up. And this goes for all other Content Management Systems, &lt;strong&gt;Joomla, Drupal...&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bash and *nix commands:&lt;/strong&gt; I know this is very important for developers to know a thing or two about, I can create, copy, move, rename and  delete files and directories, I can also print working directory, change directories, use cat and echo commands &lt;em&gt;primitively&lt;/em&gt; and that's all I know about the CLI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SSH:&lt;/strong&gt; I have seen tutorials on how to set up github ssh on my local computer but I just follow along and don't know what I'm doing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Git and Github:&lt;/strong&gt; I have &lt;em&gt;initializing a git repository, staging/tracking changes, committing changes and pushing to the github repo&lt;/em&gt; covered every other thing I do with my github are googled and since I have not started working on Open Source Projects just yet, I have no idea how &lt;em&gt;pull requests (PR), branching and merging&lt;/em&gt; work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSS Animations&lt;/strong&gt;: This is probably the most nagging issue I have with my CSS game.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JavaScript Terminologies:&lt;/strong&gt; &lt;em&gt;Bubbling, Hoisting, prototypal inheritance, DNS and &lt;code&gt;use strict&lt;/code&gt;&lt;/em&gt; are all still fuzzy to me. While I can write code that implements some of them, I do not have full understanding of these terms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Package Managers:&lt;/strong&gt; I can install packages and dependencies with npm, (I have never tried yarn), I can also &lt;code&gt;npx create-react-app&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSS Preprocessors:&lt;/strong&gt; I only know the little SASS codes from FreeCodeCamp's curriculum.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSS Architecture:&lt;/strong&gt; &lt;em&gt;What are those?&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CORS:&lt;/strong&gt; It's a nightmare! I hate seeing them and have no idea how to skirt them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GraphQL:&lt;/strong&gt; Recently found out that it is a query language and is used by the github API. I have no idea how this works.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Graphics&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deployment:&lt;/strong&gt; I just drag and drop my build files to Netlify.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Redux:&lt;/strong&gt; I have never gotten a hang of redux, probably because I have not used it in any project I have worked on. The introduction of the &lt;code&gt;useReducer&lt;/code&gt; hook by react has me thinking if there is still any need to use redux. (&lt;em&gt;kindly drop your take in the comment section&lt;/em&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I am currently focusing on the front end of things, so this list is populated with concepts and technologies used in a front end development.&lt;/p&gt;

&lt;p&gt;All of these concepts and technologies are those I am currently on a path to learn and updates will be made at regular intervals as I continue my web development journey.&lt;/p&gt;

&lt;p&gt;Sometime very soon, this list will be reduced to nothing and I will have new concepts and technologies I can publicly say I don't know.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
