<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Untitled Publication]]></title><description><![CDATA[Untitled Publication]]></description><link>https://yourwonder.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 17:42:41 GMT</lastBuildDate><atom:link href="https://yourwonder.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Arrow Functions]]></title><description><![CDATA[Introduction To JavaScript Arrow Functions

An arrow function expression is a syntactically compact alternative to a regular function expression, although without its own bindings to the this, arguments, super, or new.target keywords. Arrow functions...]]></description><link>https://yourwonder.hashnode.dev/arrow-functions</link><guid isPermaLink="true">https://yourwonder.hashnode.dev/arrow-functions</guid><dc:creator><![CDATA[Daniel Mere]]></dc:creator><pubDate>Fri, 15 May 2020 13:44:17 GMT</pubDate><content:encoded><![CDATA[<h1 id="introduction-to-javascript-arrow-functions">Introduction To JavaScript Arrow Functions</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1589550552934/HlJDIvSQY.png" alt="js-arrow.png"></p>
<p>An arrow function expression is a syntactically compact alternative to a regular function expression, although without its own bindings to the this, arguments, super, or new.target keywords. Arrow functions are always function expressions; there is no arrow function declaration.  Arrow function expressions are ill suited as methods, and they cannot be used as constructors.</p>
<h2 id="syntax">Syntax</h2>
<p>The descriptive declarations below contain the basic syntax of an arrow function.</p>
<pre><code class="lang-js">(param1, param2, …, paramN) =&gt; { statements } 
(param1, param2, …, paramN) =&gt; expression
<span class="hljs-comment">// equivalent to: =&gt; { return expression; }</span>

<span class="hljs-comment">// Parentheses are optional when there's only one parameter name:</span>
(singleParam) =&gt; { statements }
singleParam =&gt; { statements }

<span class="hljs-comment">// The parameter list for a function with no parameters should be written with a pair of parentheses.</span>
() =&gt; { statements }
</code></pre>
<p>Let&#39;s declare a constant called perimeter...</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> perimeter = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">value1, value2, value3</span>) </span>{
  <span class="hljs-keyword">return</span> value1 + value2 + value3;
};
<span class="hljs-built_in">console</span>.log(perimeter(<span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">9</span>));

<span class="hljs-comment">//21</span>
</code></pre>
<p>That above is the old JavaScript way. With arrow functions, we have a cleaner way to write the same code. To convert to an arrow function, we remove the function keyword and put a fat arrow between the body and the parameters.</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> perimeter = (value1, value2, value3) =&gt; {
  <span class="hljs-keyword">return</span> value1 + value2 + value3;
};
<span class="hljs-built_in">console</span>.log(perimeter(<span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">9</span>));
<span class="hljs-comment">//21</span>
</code></pre>
<p>We can make this code much cleaner. Since the body of the function includes only a single line of code and returns a value, the code can be made even shorter by removing the return keyword as well as the curly braces</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> perimeter = (value1, value2, value3) =&gt; value1 + value2 + value3;
<span class="hljs-built_in">console</span>.log(perimeter(<span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">9</span>));
<span class="hljs-comment">//21</span>
</code></pre>
<p>The function below takes zero parameters </p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> noParameter = () =&gt; <span class="hljs-string">"I have no parameter"</span>;
<span class="hljs-built_in">console</span>.log(noParameter());
<span class="hljs-comment">// Expected Output: I have no parameter</span>
</code></pre>
<p>If there is only a single parameter, we don&#39;t include the parenthesis. </p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> square = number =&gt; number * number;
<span class="hljs-built_in">console</span>.log(square(<span class="hljs-number">4</span>));
<span class="hljs-comment">//16</span>
</code></pre>
<p>Let’s look at the regular function expression involving arrays. In the function expression below, the array method map() is used to obtain the length of the individual length of each name in the array.</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> developers = [<span class="hljs-string">"Blanc"</span>, <span class="hljs-string">"Gozzy"</span>, <span class="hljs-string">"Bern"</span>, <span class="hljs-string">"Daniel"</span>];

<span class="hljs-keyword">const</span> devLength = developers.map(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">dev</span>) </span>{
  <span class="hljs-keyword">return</span> dev.length;
});
<span class="hljs-built_in">console</span>.log(devLength);
<span class="hljs-comment">//Expected Output: Array[ 5, 5, 4, 6 ]</span>
</code></pre>
<p>ES6 arrow functions provides an alternative way to write a shorter syntax compared to the function expression.</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> developers = [<span class="hljs-string">"Blanc"</span>, <span class="hljs-string">"Gozzy"</span>, <span class="hljs-string">"Bern"</span>, <span class="hljs-string">"Daniel"</span>];

<span class="hljs-comment">// This statement returns the array: [5, 5, 4, 6]</span>
developers.map(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">developer</span>) </span>{
  <span class="hljs-keyword">return</span> developer.length;
});

<span class="hljs-comment">// The regular function above can be written as the arrow function below</span>
developers.map((developer) =&gt; {
  <span class="hljs-keyword">return</span> developer.length;
}); <span class="hljs-comment">// [5, 5, 4, 6]</span>

<span class="hljs-comment">// When there is only one parameter, we can remove the surrounding parentheses</span>
developers.map((developer) =&gt; {
  <span class="hljs-keyword">return</span> developer.length;
}); <span class="hljs-comment">// [5, 5, 4, 6]</span>

<span class="hljs-comment">// When the only statement in an arrow function is `return`, we can remove `return` and remove</span>
<span class="hljs-comment">// the surrounding curly brackets</span>
developers.map((developer) =&gt; developer.length); <span class="hljs-comment">// [5, 5, 4, 6]</span>
</code></pre>
<p>One of the factors that influenced the introduction of arrow functions was the need for shorter functions. The above function expression can be made shorter with just a single line of code.</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> developers = [<span class="hljs-string">"Blanc"</span>, <span class="hljs-string">"Gozzy"</span>, <span class="hljs-string">"Bern"</span>, <span class="hljs-string">"Daniel"</span>];

<span class="hljs-built_in">console</span>.log(developers.map((dev) =&gt; dev.length));
<span class="hljs-comment">//Expected Output: Array[ 5, 5, 4, 6 ]</span>
</code></pre>
<p>Now that we know that one line function does not need braces. Let’s say we have an array of developers, each person is an object. We can use an array method called filter() to check for the developers under 28 years of age. In the example below, the first object in the array does not make the last print out of the array list because his age is above 28.</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> developers = [
  {
    name: <span class="hljs-string">"Nnochiri Ezekiel"</span>,
    age: <span class="hljs-number">45</span>,
  },
  {
    name: <span class="hljs-string">"Okpara Favour"</span>,
    age: <span class="hljs-number">26</span>,
  },
  {
    name: <span class="hljs-string">"Eze Bernardine"</span>,
    age: <span class="hljs-number">23</span>,
  },
  {
    name: <span class="hljs-string">"Mere Daniel"</span>,
    age: <span class="hljs-number">27</span>,
  },
];

<span class="hljs-keyword">const</span> under28 = developers.filter(developer =&gt; developer.age &lt; <span class="hljs-number">28</span>);
<span class="hljs-built_in">console</span>.log(under28);
<span class="hljs-comment">/*
Expected Output: [ { name: 'Okpara Favour', age: 26 },
  { name: 'Eze Bernardine', age: 23 },
  { name: 'Mere Daniel', age: 27 } ]
*/</span>
</code></pre>
<p>Let’s explore another method of finding the first object in the array which seems to have been excluded because of its age.</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> developers = [
  {
    name: <span class="hljs-string">"Nnochiri Ezekiel"</span>,
    age: <span class="hljs-number">45</span>,
  },
  {
    name: <span class="hljs-string">"Okpara Favour"</span>,
    age: <span class="hljs-number">26</span>,
  },
  {
    name: <span class="hljs-string">"Eze Bernardine"</span>,
    age: <span class="hljs-number">23</span>,
  },
  {
    name: <span class="hljs-string">"Mere Daniel"</span>,
    age: <span class="hljs-number">27</span>,
  },
];

<span class="hljs-comment">//const under28 = developers.filter(developer =&gt; developer.age &lt; 28)</span>

<span class="hljs-keyword">const</span> developer = developers.find(developer =&gt; developer.age === <span class="hljs-number">45</span>);
<span class="hljs-built_in">console</span>.log(developer.name);
<span class="hljs-comment">//Expected Output: Nnochiri Ezekiel</span>
</code></pre>
<p>Arrow function make functional programming code look cleaner and solve closure problems with readable and minimal syntax. </p>
]]></content:encoded></item><item><title><![CDATA[Building A Simple React App]]></title><description><![CDATA[An overview of the fundamentals of React

Before we start, let's quickly run through a couple of tools that should be in place before you start using or learning React.

Basic familiarity with HTML & CSS.
Basic knowledge of JavaScript and programming...]]></description><link>https://yourwonder.hashnode.dev/building-a-simple-react-app</link><guid isPermaLink="true">https://yourwonder.hashnode.dev/building-a-simple-react-app</guid><dc:creator><![CDATA[Daniel Mere]]></dc:creator><pubDate>Wed, 13 May 2020 22:16:10 GMT</pubDate><content:encoded><![CDATA[<h1 id="an-overview-of-the-fundamentals-of-react">An overview of the fundamentals of React</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1589552730120/-wqob4GUc.jpeg" alt="reactjs-benefits-1200x500.jpg">
Before we start, let&#39;s quickly run through a couple of tools that should be in place before you start using or learning React.</p>
<ul>
<li>Basic familiarity with HTML &amp; CSS.</li>
<li>Basic knowledge of JavaScript and programming.</li>
<li>Basic understanding of the DOM.</li>
<li>Familiarity with ES6 syntax and features.</li>
<li>Node.js and npm installed globally.</li>
<li>Node.js and npm installed globally.</li>
</ul>
<p>The <strong>goal </strong>of this article is to guide beginners to</p>
<ul>
<li>Learn about essential React concepts and related terms, such as components, props and state</li>
<li>Build a very simple React app that demonstrates the above concepts.</li>
</ul>
<p><strong>Setup and Installation</strong></p>
<p>Facebook has created Create React App, an environment that comes pre-configured with everything you need to build a React app. It will create a live development server, use Webpack to automatically compile React, JSX, and ES6, auto-prefix CSS files, and use ESLint to test and warn about mistakes in the code.</p>
<p>To set up a react app, run the following code in your terminal, one directory up from where you want the project to live.</p>
<pre><code><span class="hljs-attribute">npx</span> create-react-app reactapp
</code></pre><p>Once that finishes installing, move to the newly created directory and start the project.</p>
<pre><code>     <span class="hljs-built_in">cd</span> react-tutorial
     npm start
</code></pre><p>Once you run this command, a new window will popup at localhost:3000 with your new React app.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1589378747937/KfV_PsTOC.png" alt="screen1.png"></p>
<p>Now, look into the project structure, we&#39;d find the /public and /src directory, along with the regular node_modules, .gitignore, README.md, and package.json.</p>
<p>In /public, our important file is index.html, which is more like the index.html file we normally use  just 
 that is has a root div. </p>
<pre><code class="lang-html"><span class="hljs-meta">&lt;!DOCTYPE html&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"utf-8"</span> /&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"icon"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"%PUBLIC_URL%/favicon.ico"</span> /&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"viewport"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"width=device-width, initial-scale=1"</span> /&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"theme-color"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"#000000"</span> /&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span>
      <span class="hljs-attr">name</span>=<span class="hljs-string">"description"</span>
      <span class="hljs-attr">content</span>=<span class="hljs-string">"Web site created using create-react-app"</span>
    /&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"apple-touch-icon"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"%PUBLIC_URL%/logo192.png"</span> /&gt;</span>
    <span class="hljs-comment">&lt;!--
      manifest.json provides metadata used when your web app is installed on a
      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
    --&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"manifest"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"%PUBLIC_URL%/manifest.json"</span> /&gt;</span>
    <span class="hljs-comment">&lt;!--
      Notice the use of %PUBLIC_URL% in the tags above.
      It will be replaced with the URL of the `public` folder during the build.
      Only files inside the `public` folder can be referenced from the HTML.

      Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
      work correctly both with client-side routing and a non-root public URL.
      Learn how to configure a non-root public URL by running `npm run build`.
    --&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>React App<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">noscript</span>&gt;</span>You need to enable JavaScript to run this app.<span class="hljs-tag">&lt;/<span class="hljs-name">noscript</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"root"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-comment">&lt;!--
      This HTML file is a template.
      If you open it directly in the browser, you will see an empty page.

      You can add webfonts, meta tags, or analytics to this file.
      The build step will place the bundled scripts into the &lt;body&gt; tag.

      To begin the development, run `npm start` or `yarn start`.
      To create a production bundle, use `npm run build` or `yarn build`.
    --&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
<p>To see how the environment automatically compiles and updates your React code, find the line that looks like this in /src/App.js:</p>
<blockquote>
<p>To get started, edit <code>src/App.js</code> and save to reload.</p>
</blockquote>
<p>And replace it with any other text. Once you save the file, you&#39;ll notice localhost:3000 compiles and refreshes with the new data. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1589379750784/_zwRvgBks.gif" alt="screen.gif"></p>
<p>Go ahead and delete all the files out of the /src directory, and we&#39;ll create our own boilerplate file without any bloat. We&#39;ll just keep index.js.</p>
<p>For my styling, I just copy-and-pasted the CDN link of materializecss into the index.html in the public folder. If you want, you can use Bootstrap or whatever CSS framework you want, I will go with Materializecss, I just find it easier to work with.</p>
<p>Go to  <a target='_blank' rel='noopener noreferrer'  href="Link">https://materializecss.com/getting-started.html</a>  and grab the cdnjs link   <a target='_blank' rel='noopener noreferrer'  href="Link">&lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css&quot;&gt;</a> which is the latest as of the time of writing this article. Paste this link just before the title element tag in index.html in the public folder</p>
<p>Now, we start proper in index.js, we&#39;re importing React, ReactDOM. Here, we render a simple message that says </p>
<blockquote>
<p>We are fully prepare to build our react app</p>
</blockquote>
<pre><code class="lang-js">index.js
<span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
<span class="hljs-keyword">import</span> ReactDOM <span class="hljs-keyword">from</span> <span class="hljs-string">"react-dom"</span>;
<span class="hljs-keyword">const</span> message = <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">h3</span>&gt;</span>We are fully prepare to build our react app<span class="hljs-tag">&lt;/<span class="hljs-name">h3</span>&gt;</span>;</span>

ReactDOM.render(message, <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">"root"</span>));
</code></pre>
<p>We aim to create an App.js component where other components will be nested. We call it our root component. Let&#39;s render the App component in the index.js file before creating it in our src directory and import it as well. </p>
<pre><code class="lang-js">index.js
<span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
<span class="hljs-keyword">import</span> ReactDOM <span class="hljs-keyword">from</span> <span class="hljs-string">"react-dom"</span>;
<span class="hljs-keyword">import</span> App <span class="hljs-keyword">from</span> <span class="hljs-string">"./App"</span>;

ReactDOM.render(<span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">App</span> /&gt;</span>,document.getElementById("root"));</span>
</code></pre>
<p>We are going to create the App component which is going to be a class component. Class components can have state, variables, methods etc. It is used for dynamic sources of data and handles data that might change like fetching data and user events.</p>
<pre><code class="lang-js">App.js
<span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> App;
</code></pre>
<p>Importing React and exporting components is seen as a compulsory thing when building with React. else there would be errors. These errors occur during the build time and cannot be dismissed. With this, the written code fails to compile.</p>
<pre><code class="lang-js">App.js
<span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">App</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">React</span>.<span class="hljs-title">Component</span> </span>{
  render() {
    <span class="hljs-keyword">return</span> (
      <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">'container'</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">className</span>=<span class="hljs-string">'blue-text'</span>&gt;</span>World Best Footballers<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    )</span>;
  }
}
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> App;
</code></pre>
<p>The syntax we returned is neither a string nor HTML. It is called JSX, and it is a syntax extension to JavaScript. JSX comes with the full power of JavaScript. React doesn’t require using JSX, but most people find it helpful as a visual aid when working with UI inside the JavaScript code. It also allows React to show more useful error and warning messages.</p>
<p>We are going to add state into our App.js</p>
<blockquote>
<p>In the React sense, “state” is an object that represents the parts of the app that can change. Each component can maintain its own state, which lives in an object called this. state
We defined the data up in the state and pass down the properties of the state into the component.</p>
</blockquote>
<pre><code class="lang-js">App.js
<span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
<span class="hljs-keyword">import</span> Footballers <span class="hljs-keyword">from</span> <span class="hljs-string">"./Footballers"</span>;
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">App</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">React</span>.<span class="hljs-title">Component</span> </span>{
  state = {
    footballers: [
      {
        name: <span class="hljs-string">"Cristiano Ronaldo"</span>,
        club: <span class="hljs-string">"Juventus"</span>,
        position: <span class="hljs-string">"Forward"</span>,
        country: <span class="hljs-string">"Portugal"</span>,
        id: <span class="hljs-number">1</span>,
      },
      {
        name: <span class="hljs-string">"Lionel Messi"</span>,
        club: <span class="hljs-string">"Barcelona"</span>,
        position: <span class="hljs-string">"Forward"</span>,
        country: <span class="hljs-string">"Portugal"</span>,
        id: <span class="hljs-number">2</span>,
      },
    ],
  };
  render() {
    <span class="hljs-keyword">return</span> (
      <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">'container'</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">className</span>=<span class="hljs-string">'blue-text'</span>&gt;</span>World Best Footballers<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    )</span>;
  }
}
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> App;
</code></pre>
<p>Let&#39;s import a component I have created called Footballers and use its props, to display the array of objects I have created for the state.</p>
<pre><code class="lang-js">App.js
render() {
    <span class="hljs-keyword">return</span> (
      <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">'container'</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">className</span>=<span class="hljs-string">'green-text'</span>&gt;</span>World Best Footballers<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">Footballers</span> /&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    )</span>;
  }
</code></pre>
<p>Let&#39;s use the state created...</p>
<pre><code class="lang-js">App.js
<span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
<span class="hljs-keyword">import</span> Footballers <span class="hljs-keyword">from</span> <span class="hljs-string">"./Footballers"</span>;
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">App</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">React</span>.<span class="hljs-title">Component</span> </span>{
  state = {
    footballers: [
      {
        name: <span class="hljs-string">"Cristiano Ronaldo"</span>,
        club: <span class="hljs-string">"Juventus"</span>,
        position: <span class="hljs-string">"Forward"</span>,
        country: <span class="hljs-string">"Portugal"</span>,
        id: <span class="hljs-number">1</span>,
      },
      {
        name: <span class="hljs-string">"Lionel Messi"</span>,
        club: <span class="hljs-string">"Barcelona"</span>,
        position: <span class="hljs-string">"Forward"</span>,
        country: <span class="hljs-string">"Portugal"</span>,
        id: <span class="hljs-number">2</span>,
      },
    ],
  };
  render() {
    <span class="hljs-keyword">return</span> (
      <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">'container'</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">className</span>=<span class="hljs-string">'green-text'</span>&gt;</span>World Best Footballers<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">Footballers</span> <span class="hljs-attr">footballers</span>=<span class="hljs-string">{this.state.footballers}</span> /&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    )</span>;
  }
}
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> App;
</code></pre>
<p>We pass the properties in the Footballer component. Then use an ES6 arrow function to map through the individual footballers.</p>
<pre><code class="lang-js">src/App.js
<span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
<span class="hljs-keyword">const</span> Footballers = (props) =&gt; {
  <span class="hljs-keyword">const</span> { footballers } = props;
  <span class="hljs-keyword">const</span> footballersList = footballers.map((footballer) =&gt; {
    <span class="hljs-keyword">return</span> (
      <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Name:<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>club:<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>position:<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>country:<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    )</span>;
  });
};
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> Footballers;
</code></pre>
<p>Circling through this, we try to access each footballer. </p>
<pre><code class="lang-js">
src/App.js
<span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
<span class="hljs-keyword">const</span> Footballers = (props) =&gt; {
  <span class="hljs-keyword">const</span> { footballers } = props;
  <span class="hljs-keyword">const</span> footballersList = footballers.map((footballer) =&gt; {
    <span class="hljs-keyword">return</span> (
      <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">key</span> = {<span class="hljs-attr">footballer.id</span>}&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Name: {footballer.name}<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>club: {footballer.club}<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>position: {footballer.position}<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>country: {footballer.country}<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">hr</span> /&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    )</span>;
  });
  <span class="hljs-keyword">return</span> <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>{footballersList}<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>;</span>
};
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> Footballers;
</code></pre>
<p>Here, we are going to add another class component. We call it AddFootballer.js. This component would have a form. HTML form elements work a little bit differently from other DOM elements in React because form elements naturally keep some internal state. Also notice that a key prop was added to the div element that wraps the outputting JSX elements. Each child in an array or iteractor should have a unique key prop.</p>
<pre><code class="lang-js">src/AddFootballer.js
<span class="hljs-keyword">import</span> React, { Component } <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">AddFootballer</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Component</span> </span>{
  render() {
    <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">form</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">htmlFor</span>=<span class="hljs-string">'name'</span>&gt;</span>Name:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'text'</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'name'</span> <span class="hljs-attr">onChange</span>=<span class="hljs-string">{}</span> /&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">htmlFor</span>=<span class="hljs-string">'club'</span>&gt;</span>Club:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'text'</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'club'</span> <span class="hljs-attr">onChange</span>=<span class="hljs-string">{}</span> /&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">htmlFor</span>=<span class="hljs-string">'position'</span>&gt;</span>Position:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'text'</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'position'</span> <span class="hljs-attr">onChange</span>=<span class="hljs-string">{}</span> /&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">htmlFor</span>=<span class="hljs-string">'country'</span>&gt;</span>Country:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'text'</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'country'</span> <span class="hljs-attr">onChange</span>=<span class="hljs-string">{}</span> /&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">form</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   )</span>
  }
}
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> AddFootballer;
</code></pre>
<p>Adding  state to our class component..</p>
<pre><code class="lang-js">src/AddFootballer
<span class="hljs-keyword">import</span> React, { Component } <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">AddFootballer</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Component</span> </span>{
    state = {
        name: <span class="hljs-literal">null</span>,
        club: <span class="hljs-literal">null</span>,
        position: <span class="hljs-literal">null</span>,
        country: <span class="hljs-literal">null</span>
    }
  render() {
    <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">form</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">htmlFor</span>=<span class="hljs-string">'name'</span>&gt;</span>Name:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'text'</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'name'</span> <span class="hljs-attr">onChange</span>=<span class="hljs-string">{}</span> /&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">htmlFor</span>=<span class="hljs-string">'club'</span>&gt;</span>Club:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'text'</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'club'</span> <span class="hljs-attr">onChange</span>=<span class="hljs-string">{}</span> /&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">htmlFor</span>=<span class="hljs-string">'position'</span>&gt;</span>Position:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'text'</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'position'</span> <span class="hljs-attr">onChange</span>=<span class="hljs-string">{}</span> /&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">htmlFor</span>=<span class="hljs-string">'country'</span>&gt;</span>Country:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'text'</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'country'</span> <span class="hljs-attr">onChange</span>=<span class="hljs-string">{}</span> /&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">form</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   )</span>
  }
}
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> AddFootballer;
</code></pre>
<p>The component created does nothing as we have not added the necessary events it needs to function.
Handling events with React elements is very similar to handling events on DOM elements. </p>
<pre><code class="lang-js">src/AddFootballer.js
<span class="hljs-keyword">import</span> React, { Component} <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">AddFootballer</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Component</span> </span>{
  state = {
    name: <span class="hljs-literal">null</span>,
    club: <span class="hljs-literal">null</span>,
    position: <span class="hljs-literal">null</span>,
    country: <span class="hljs-literal">null</span>,
  };
  handleChange = (e) =&gt; {
    <span class="hljs-keyword">this</span>.setState({
      [e.target.id]: e.target.value,
    });
  };
  handleSubmit = (e) =&gt; {
    e.preventDefault();
    <span class="hljs-built_in">console</span>.log(<span class="hljs-keyword">this</span>.state);
  };
  render() {
    <span class="hljs-keyword">return</span> (
      <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">form</span> <span class="hljs-attr">onSubmit</span>=<span class="hljs-string">{this.handleSubmit}</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">htmlFor</span>=<span class="hljs-string">'name'</span>&gt;</span>Name:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'text'</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'name'</span> <span class="hljs-attr">onChange</span>=<span class="hljs-string">{this.handleChange}</span> /&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">htmlFor</span>=<span class="hljs-string">'club'</span>&gt;</span>Club:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'text'</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'club'</span> <span class="hljs-attr">onChange</span>=<span class="hljs-string">{this.handleChange}</span> /&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">htmlFor</span>=<span class="hljs-string">'position'</span>&gt;</span>Position:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'text'</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'position'</span> <span class="hljs-attr">onChange</span>=<span class="hljs-string">{this.handleChange}</span> /&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">htmlFor</span>=<span class="hljs-string">'country'</span>&gt;</span>Country:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'text'</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'country'</span> <span class="hljs-attr">onChange</span>=<span class="hljs-string">{this.handleChange}</span> /&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">button</span>&gt;</span>Submit<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">form</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    )</span>;
  }
}
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> AddFootballer;
</code></pre>
<p>In the code above, e is a synthetic event. React defines these synthetic events according to the W3C spec, so you don’t need to worry about cross-browser compatibility.</p>
<p>In the App.js, we create a function that handles the events which add data to our Array data.</p>
<pre><code class="lang-js">src/App.js
Addfootballer = (footballer) =&gt; {
    footballer.id = <span class="hljs-built_in">Math</span>.random();
    <span class="hljs-keyword">let</span> footballers = [...this.state.footballers, footballer];
    <span class="hljs-keyword">this</span>.setState({
      footballers: footballers,
    });
  };
  render() {
    <span class="hljs-keyword">return</span> (
      <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">'container'</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">className</span>=<span class="hljs-string">'blue-text'</span>&gt;</span>List of World Best Footballers<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">AddFootballer</span> <span class="hljs-attr">footballers</span>=<span class="hljs-string">{this.state.footballers}</span> /&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">AddFootballers</span> <span class="hljs-attr">addfootballer</span>=<span class="hljs-string">{this.Addfootballer}</span> /&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    )</span>;
  }
}
</code></pre>
<p>This now becomes the full screen of App.js file..</p>
<pre><code class="lang-js">src/App.js
<span class="hljs-keyword">import</span> React, { Component } <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
<span class="hljs-keyword">import</span> Footballer <span class="hljs-keyword">from</span> <span class="hljs-string">"./Footballer"</span>;
<span class="hljs-keyword">import</span> AddFootballers <span class="hljs-keyword">from</span> <span class="hljs-string">"./AddFootballer"</span>;

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">App</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Component</span> </span>{
  state = {
    footballers: [
      {
        name: <span class="hljs-string">"Christiano Ronaldo"</span>,
        club: <span class="hljs-string">"Juventus"</span>,
        position: <span class="hljs-string">"Forward"</span>,
        country: <span class="hljs-string">"Portugal"</span>,
        id: <span class="hljs-number">1</span>,
      },
      {
        name: <span class="hljs-string">"Lionel Messi"</span>,
        club: <span class="hljs-string">"Barcelona"</span>,
        position: <span class="hljs-string">"Forward"</span>,
        country: <span class="hljs-string">"Argentina"</span>,
        id: <span class="hljs-number">2</span>,
      },
    ],
  };
  Addfootballer = (footballer) =&gt; {
    footballer.id = <span class="hljs-built_in">Math</span>.random();
    <span class="hljs-keyword">let</span> footballers = [...this.state.footballers, footballer];
    <span class="hljs-keyword">this</span>.setState({
      footballers: footballers,
    });
  };
  render() {
    <span class="hljs-keyword">return</span> (
      <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">'container'</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">className</span>=<span class="hljs-string">'blue-text'</span>&gt;</span>List of World Best Footballers<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">Footballer</span> <span class="hljs-attr">footballers</span>=<span class="hljs-string">{this.state.footballers}</span> /&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">AddFootballers</span> <span class="hljs-attr">addfootballer</span>=<span class="hljs-string">{this.Addfootballer}</span> /&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    )</span>;
  }
}

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> App;
</code></pre>
<p>Going back to the AddFootballer component, we remove the <em>console.log(this.state)</em> which only enabled us to view the added array in the console.</p>
<pre><code class="lang-js">src/AddFootballer.js
handleSubmit = (e) =&gt; {
    e.preventDefault();
    <span class="hljs-keyword">this</span>.props.addfootballer(<span class="hljs-keyword">this</span>.state);
  };
</code></pre>
<p>Here is the full screen</p>
<pre><code class="lang-js">src/AddFootballer.js
<span class="hljs-keyword">import</span> React,{ Component } <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">AddFootballer</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Component</span> </span>{
  state = {
    name: <span class="hljs-literal">null</span>,
    club: <span class="hljs-literal">null</span>,
    position: <span class="hljs-literal">null</span>,
    country: <span class="hljs-literal">null</span>,
  };
  handleChange = (e) =&gt; {
    <span class="hljs-keyword">this</span>.setState({
      [e.target.id]: e.target.value,
    });
  };
  handleSubmit = (e) =&gt; {
    e.preventDefault();
    <span class="hljs-keyword">this</span>.props.addfootballer(<span class="hljs-keyword">this</span>.state);
  };
  render() {
    <span class="hljs-keyword">return</span> (
      <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">form</span> <span class="hljs-attr">onSubmit</span>=<span class="hljs-string">{this.handleSubmit}</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">htmlFor</span>=<span class="hljs-string">'name'</span>&gt;</span>Name:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'text'</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'name'</span> <span class="hljs-attr">onChange</span>=<span class="hljs-string">{this.handleChange}</span> /&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">htmlFor</span>=<span class="hljs-string">'name'</span>&gt;</span>Club:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'text'</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'club'</span> <span class="hljs-attr">onChange</span>=<span class="hljs-string">{this.handleChange}</span> /&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">htmlFor</span>=<span class="hljs-string">'name'</span>&gt;</span>Position:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'text'</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'position'</span> <span class="hljs-attr">onChange</span>=<span class="hljs-string">{this.handleChange}</span> /&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">htmlFor</span>=<span class="hljs-string">'name'</span>&gt;</span>Country:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'text'</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'country'</span> <span class="hljs-attr">onChange</span>=<span class="hljs-string">{this.handleChange}</span> /&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">button</span>&gt;</span>Submit<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">form</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    )</span>;
  }
}
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> AddFootballer;
</code></pre>
<p>Below is an overview of our simple React App</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1589407295903/1ax5SH-fp.gif" alt="footballer.gif"></p>
]]></content:encoded></item></channel></rss>