<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ismail Oladimej Oladokun on Medium]]></title>
        <description><![CDATA[Stories by Ismail Oladimej Oladokun on Medium]]></description>
        <link>https://medium.com/@ismailoladimejoladokun?source=rss-1ce54efaca02------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*tTSl-rwDRihSutUQ</url>
            <title>Stories by Ismail Oladimej Oladokun on Medium</title>
            <link>https://medium.com/@ismailoladimejoladokun?source=rss-1ce54efaca02------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 03:38:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ismailoladimejoladokun/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[useContext  in react
React context gives us means of providing data data to components no matter…]]></title>
            <link>https://medium.com/@ismailoladimejoladokun/usecontext-in-react-react-context-gives-us-means-of-providing-data-data-to-components-no-matter-7542b1b74c62?source=rss-1ce54efaca02------2</link>
            <guid isPermaLink="false">https://medium.com/p/7542b1b74c62</guid>
            <dc:creator><![CDATA[Ismail Oladimej Oladokun]]></dc:creator>
            <pubDate>Tue, 21 Jun 2022 20:46:22 GMT</pubDate>
            <atom:updated>2022-06-21T20:46:22.399Z</atom:updated>
            <content:encoded><![CDATA[<p>useContext in react<br>React context gives us means of providing data data to components no matter how deep they are in component tree. In other word, it gives us way of passing data across the component tree without having to pass the as props manually.<br>The below diagram show way providing data along component tree manually as props.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GGh0h-o2z0h2fmQHOMf7TA.png" /></figure><p>The critical analysis show that for <br>1. component A :It very easy and straight forward.</p><p>2.Component D : This component is a child of B that does need username, it <br>become verbose and make sense to pass props along component B.</p><p>3.Component F: The props has to be passed onto C and E which is unnecessary.</p><p>This the problem context Api want to solve</p><p><strong>How to use context hook in react</strong></p><ol><li>creating the context</li><li>providing the context</li><li>consuming the context</li></ol><p>This little application shows how use context hook in functional component.<br>We start by creating context as shown by code snippet below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*cIrdQCU9OTVP6v4BzQ59eg.png" /></figure><p>My intention is share the data movies. so, in order to do this , I needed to import createContext from react and then create MovieContext from createContext as shown in the second line.<br>Then create a function that shares the data called MovieProvider.Return the movieContext.<br>Consuming the context<br>1. MovieList</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*_6z60ztLd7aachC8JPdBBw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*50aW0XLyjBH7o0kB35lRMA.png" /></figure><p>2. Nav</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*3ihHSC7AhHrDRwxcuiq7Zg.png" /></figure><p>3. AddMovie</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*F9DH8fsxqbsyxOSTngtFXg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7542b1b74c62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hooks and functional component]]></title>
            <link>https://medium.com/@ismailoladimejoladokun/hooks-and-functional-component-cb2f20866f84?source=rss-1ce54efaca02------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb2f20866f84</guid>
            <dc:creator><![CDATA[Ismail Oladimej Oladokun]]></dc:creator>
            <pubDate>Mon, 20 Jun 2022 15:25:05 GMT</pubDate>
            <atom:updated>2022-06-20T15:25:05.766Z</atom:updated>
            <content:encoded><![CDATA[<p>Hooks and functional component</p><p>As we all know in react ecosystem there are two basic types of components. They are functional and class components. functional component are summarily are stateless components , meaning they are traditionally not use to manage state properties while class component are stateful components that they can be use to manage state properties.<strong> What are states</strong> ?<br>states are pieces of information that allow us to have control over previous events or user interactions.<br>steps towards achieving these are <br> 1. import useState from react</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*ew8nwm-P3IGVMf907bZjZw.png" /></figure><p>2. call useState and destructure it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*dbT-k-zEJH_2DLFCILIXNg.png" /></figure><p>3. Create an handlerFunction called (updateUserQuery) here in this example to call the setUserQuery with the expected parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*HtEkC9pIFqwdlVZK0pZ39w.png" /></figure><p>4. Next is to attached the handlerFunction to onChange on the input element</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*WLjE2QKLObb5_xiO5dO2HQ.png" /></figure><p>5. Create a function that does google searching call it googleSearch</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*-afqZH0Lcdm2umlfcV1Uqg.png" /></figure><p>6. The function googleSearch above can be called on onKeyPress or onClick <br>of Enter key or clicking of button respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*9gUToCyBHs3k4LcCPgCGPA.png" /></figure><p>7. complete code for the whole process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*Mg7ka_eqF8NWQ9Nn97nnug.png" /></figure><p>9. picture of the UI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*yRgCRYa7RldZzQ8WUZAWfg.png" /></figure><p>10. search interface</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/265/1*jf38_4ZzH5KkyA-ag10CyA.png" /></figure><p>11. page search material</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XeUFE0pfpWyKHKR9Ty6bMg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb2f20866f84" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hooks in react.js]]></title>
            <link>https://medium.com/@ismailoladimejoladokun/hooks-in-react-js-da9249c92249?source=rss-1ce54efaca02------2</link>
            <guid isPermaLink="false">https://medium.com/p/da9249c92249</guid>
            <dc:creator><![CDATA[Ismail Oladimej Oladokun]]></dc:creator>
            <pubDate>Tue, 24 May 2022 05:59:59 GMT</pubDate>
            <atom:updated>2022-05-24T05:59:59.433Z</atom:updated>
            <content:encoded><![CDATA[<p>Hooks in react.js</p><p>React hooks allow us to use a functional component to have access and control of the internal state of an application. In this article I am going to use two most popular hooks. The are <strong>useState and useEffect. Let consider the snippet below and explanation. UseState is a Hook that lets you add React state to functional components.</strong></p><p>Our new example starts by importing the useState Hook from React.</p><p>import React , {useState} from “ react”<br>export <em>const</em> Joke = () =&gt; {</p><p><em>const</em> [users, setUsers] = useState({});<br>//The first is to destructure the useState into users and setUsers,<br>Initially,the users is an empty object ,when async resquest is made ,the <br>useState is set to the require state.</p><p>next is to use useEffect to make side effect the application.<br>The first is to make async request with fetch Api.</p><p><em>const</em> fetchData = <em>async</em> () =&gt; {</p><p><em>const</em> url = `https://jsonplaceholder.typicode.com/users`;</p><p><em>const</em> response = await fetch(url);</p><p><em>const</em> usersData = await response.json()</p><p>setUsers(usersData);</p><p>}</p><p>After making request to third party api ,then we will call the fetchData function in useEffect. The useEffect accept two parameters the callback function and a set of dependencies.</p><p>useEffect(() =&gt; {</p><p>fetchData();</p><p>}, [])</p><p>import React, { useEffect, useState } from ‘react’</p><p>export <em>const</em> Joke = () =&gt; {</p><p><em>const</em> [users, setUsers] = useState({});</p><p><em>/* useEffect(() =&gt; {</em></p><p><em>const url = `https://jsonplaceholder.typicode.com/users`</em></p><p><em>fetch(url)</em></p><p><em>.then(response =&gt; response.json())</em></p><p><em>.then(usersData =&gt; {</em></p><p><em>console.log(‘myJoke:’, usersData);</em></p><p><em>setUsers(usersData);</em></p><p><em>})</em></p><p><em>}, [])*/</em></p><p><em>const</em> fetchData = <em>async</em> () =&gt; {</p><p><em>const</em> url = `https://jsonplaceholder.typicode.com/users`;</p><p><em>const</em> response = await fetch(url);</p><p><em>const</em> usersData = await response.json()</p><p>setUsers(usersData);</p><p>}</p><p>useEffect(() =&gt; {</p><p>fetchData();</p><p>}, [])</p><p>console.log(users)</p><p>return (</p><p>&lt;div&gt;</p><p>&lt;h3&gt;The ten users to be fetch&lt;/h3&gt;</p><p>&lt;table&gt;</p><p>&lt;thead&gt;</p><p>&lt;tr&gt;</p><p>&lt;th&gt;Name&lt;/th&gt;</p><p>&lt;th&gt;Username&lt;/th&gt;</p><p>&lt;th&gt;Email&lt;/th&gt;</p><p>&lt;th&gt;phone&lt;/th&gt;</p><p>&lt;/tr&gt;</p><p>&lt;/thead&gt;</p><p>{</p><p>users.map(({ <em>email</em>, <em>name</em>, <em>username</em>, <em>phone</em>, <em>id</em> }) =&gt; (</p><p>&lt;tbody&gt;</p><p>&lt;tr <em>key</em>={id}&gt;</p><p>&lt;td&gt;{name}&lt;/td&gt;</p><p>&lt;td&gt;{username}&lt;/td&gt;</p><p>&lt;td&gt;{email}&lt;/td&gt;</p><p>&lt;td&gt;{phone}&lt;/td&gt;</p><p>&lt;/tr&gt;</p><p>&lt;/tbody&gt;</p><p>))</p><p>}</p><p>&lt;/table&gt;</p><p>&lt;/div&gt;</p><p>)</p><p>}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1VrQVD0c0imGxyKoe-vLZA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da9249c92249" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>