<?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 Ayeni Ayobami on Medium]]></title>
        <description><![CDATA[Stories by Ayeni Ayobami on Medium]]></description>
        <link>https://medium.com/@pechbusorg?source=rss-d23d754163df------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DpiCqUyYLnrSH5icrIZB1w.jpeg</url>
            <title>Stories by Ayeni Ayobami on Medium</title>
            <link>https://medium.com/@pechbusorg?source=rss-d23d754163df------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 19:23:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pechbusorg/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[Using react-native-rn-voicekit: A Voice-to-Text Library for React Native]]></title>
            <link>https://medium.com/@pechbusorg/using-react-native-rn-voicekit-a-voice-to-text-library-for-react-native-ea9b8f41aa35?source=rss-d23d754163df------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea9b8f41aa35</guid>
            <category><![CDATA[voice-interfaces]]></category>
            <category><![CDATA[text-to-voice]]></category>
            <category><![CDATA[speech-recognition]]></category>
            <dc:creator><![CDATA[Ayeni Ayobami]]></dc:creator>
            <pubDate>Sun, 28 Sep 2025 22:04:34 GMT</pubDate>
            <atom:updated>2025-09-28T22:04:34.116Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XC9WW0CGeU49AH2Lnkwr5Q.png" /></figure><p>Voice input is becoming an essential feature for modern apps. With speech recognition, users can interact hands-free, improve accessibility, and make your app feel more natural.</p><p>In this guide, I’ll show you how to <strong>integrate and use </strong><a href="https://www.npmjs.com/package/react-native-rn-voicekit"><strong>react-native-rn-voicekit</strong></a>, a React Native library that lets you easily add <strong>voice-to-text</strong> functionality on both iOS and Android.</p><h3>Installation</h3><p>Install the package via NPM or Yarn:</p><pre>npm install react-native-rn-voicekit<br># or<br>yarn add react-native-rn-voicekit</pre><p>Then rebuild your project so native code is linked:</p><pre>cd ios &amp;&amp; pod install &amp;&amp; cd ..<br>npm run ios<br># or<br>npm run android</pre><h3>Setup</h3><h3>iOS</h3><p>Add these permissions to your <strong>Info.plist</strong>:</p><pre>&lt;key&gt;NSSpeechRecognitionUsageDescription&lt;/key&gt;<br>&lt;string&gt;App needs access to speech recognition&lt;/string&gt;<br>&lt;key&gt;NSMicrophoneUsageDescription&lt;/key&gt;<br>&lt;string&gt;App needs access to the microphone&lt;/string&gt;</pre><p>Run on a real device (speech recognition doesn’t work on iOS simulators by default).</p><h3>Android</h3><p>Add microphone permission to <strong>AndroidManifest.xml</strong>:</p><pre>&lt;uses-permission android:name=&quot;android.permission.RECORD_AUDIO&quot; /&gt;</pre><h3>Usage Example</h3><p>Here’s a simple example of how to use the library in your app:</p><pre>import React, { useEffect, useState } from &#39;react&#39;;<br>import { Button, SafeAreaView, Text, ScrollView } from &#39;react-native&#39;;<br>import { NativeEventEmitter, NativeModules } from &#39;react-native&#39;;<br><br>const { RnVoicekit } = NativeModules;<br>const voiceEmitter = new NativeEventEmitter(RnVoicekit);<br><br>export default function App() {<br>  const [logs, setLogs] = useState&lt;string[]&gt;([]);<br><br>  const addLog = (msg: string) =&gt; setLogs(prev =&gt; [msg, ...prev]);<br><br>  useEffect(() =&gt; {<br>    const subs = [<br>      voiceEmitter.addListener(&#39;onSpeechStart&#39;, () =&gt; addLog(&#39;🎤 Speech started&#39;)),<br>      voiceEmitter.addListener(&#39;onSpeechEnd&#39;, () =&gt; addLog(&#39;🛑 Speech ended&#39;)),<br>      voiceEmitter.addListener(&#39;onSpeechResults&#39;, (e: { value: string[] }) =&gt;<br>        addLog(`✅ Final: ${e.value.join(&#39; &#39;)}`)<br>      ),<br>      voiceEmitter.addListener(&#39;onSpeechPartialResults&#39;, (e: { value: string[] }) =&gt;<br>        addLog(`⌛ Partial: ${e.value.join(&#39; &#39;)}`)<br>      ),<br>      voiceEmitter.addListener(&#39;onSpeechError&#39;, (e: { code: string; message: string }) =&gt;<br>        addLog(`❌ Error: ${e.message}`)<br>      ),<br>    ];<br>    return () =&gt; subs.forEach(s =&gt; s.remove());<br>  }, []);<br><br>  const start = async () =&gt; {<br>    await RnVoicekit.start({ locale: &#39;en-US&#39;, partialResults: true });<br>    addLog(&#39;▶️ Started listening...&#39;);<br>  };<br><br>  const stop = async () =&gt; {<br>    await RnVoicekit.stop();<br>    addLog(&#39;⏹️ Stopped listening&#39;);<br>  };<br><br>  const cancel = async () =&gt; {<br>    await RnVoicekit.cancel();<br>    addLog(&#39;❌ Cancelled&#39;);<br>  };<br><br>  return (<br>    &lt;SafeAreaView style={{ flex: 1, padding: 20 }}&gt;<br>      &lt;Button title=&quot;Start&quot; onPress={start} /&gt;<br>      &lt;Button title=&quot;Stop&quot; onPress={stop} /&gt;<br>      &lt;Button title=&quot;Cancel&quot; onPress={cancel} /&gt;<br>      &lt;ScrollView&gt;<br>        {logs.map((l, i) =&gt; (<br>          &lt;Text key={i}&gt;{l}&lt;/Text&gt;<br>        ))}<br>      &lt;/ScrollView&gt;<br>    &lt;/SafeAreaView&gt;<br>  );<br>}</pre><h3>Features</h3><p>Start, stop, or cancel recognition</p><p>Partial &amp; ✅ final transcription events</p><p>Works with both iOS (Speech framework) and Android (SpeechRecognizer API)</p><p>Easy to integrate, built as a TurboModule for performance</p><h3>Conclusion</h3><p>With react-native-rn-voicekit, you can give your React Native apps <strong>hands-free input</strong> in just a few lines of code. It’s a simple and lightweight wrapper around native speech recognition APIs, designed to make voice features accessible to everyone.</p><p>👉 <a href="https://www.npmjs.com/package/react-native-rn-voicekit">Check it out on npm</a></p><p>✨ Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea9b8f41aa35" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HOC- Higher order Component — React Native/JS]]></title>
            <link>https://medium.com/@pechbusorg/hoc-higher-order-component-react-native-js-7233bdf7bbac?source=rss-d23d754163df------2</link>
            <guid isPermaLink="false">https://medium.com/p/7233bdf7bbac</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[hoc]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[components]]></category>
            <dc:creator><![CDATA[Ayeni Ayobami]]></dc:creator>
            <pubDate>Tue, 02 Aug 2022 01:39:45 GMT</pubDate>
            <atom:updated>2022-08-02T17:01:55.596Z</atom:updated>
            <content:encoded><![CDATA[<h3>HOC- Higher order Component — React Native/JS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*Yr7LhIEgIBGQ6RRd6HPmaQ.png" /></figure><p>Have you ever been in a situation where you have to re-write a particular component logic more than once, most of you readers might say why not separate the logic from the components and then reference the logic from components that needs the logic, what if the logic is tied to UI components? Then referencing an external logic becomes a problem. With the increase in the rate at which we make use of CDD (Component driven development), how easy would you handle repeated logic within those components?</p><p>How would you handle it, if a user has been logged in and you want to check the user’s login status in multiple components or pass the user’s data to numerous components? you may also answer and say use props, but that will mean having the same props on all the components and you would have to pass the data to all the components.</p><p>What if you are trying to build an application and you can’t use redux, don’t ask “Why can’t I use redux”, an interview process make require you to build an app and they will specify that you do not use Redux,</p><p>In all of these scenarios, what do you do?</p><p>Don’t worry react has seen this problem before you do, and hence the creation of Higher-order component (HOC)</p><p>According to the react documentation….</p><p>A higher-order component (HOC) is <strong>an advanced technique in React for reusing component logic</strong>. HOCs are not part of the React API. They are a pattern that emerges from React’s compositional nature. Concretely, a higher-order component is a function that takes a component and returns a new component.</p><p>This High order components concept is from the famous High-order function concept.</p><p>The basic definition of High order function is a function called high order function if it either accepts a function as an argument or returns another function. But now let’s talk about the benefit of writing a high-order function. In javascript, we are trying to write less amount of code and try to reuse the same code or functionality as many times as we can. High order function way of writing code allows us to implement currying in Javascript. Now, what is this currying? Currying is a way of writing code where you write a common functionality and change the functionality via argument. Let me give you an example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3df170fe3fd392c5ba1e8ee6f11e6ccd/href">https://medium.com/media/3df170fe3fd392c5ba1e8ee6f11e6ccd/href</a></iframe><p>This function is high order function as this returns a new function. This function will act as a function generator for different functionalities. For example, I can create a double function by using the above high-order function:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/69d596e85e89d35989d53b2fe381d271/href">https://medium.com/media/69d596e85e89d35989d53b2fe381d271/href</a></iframe><p>Similarly, I can use the same high-order function to generate a triple function which takes the number as an argument and return three times the number.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fc3ef89868e4ca32b9292be5417402ef/href">https://medium.com/media/fc3ef89868e4ca32b9292be5417402ef/href</a></iframe><p>This type of function generation is known as currying in javascript. It is a better way of writing code as this decouples the base functionality with final logic. The base logic can be re-used in multiple places.</p><p>Enough of HOF, our primary aim is the talk about HOC</p><p>With the knowledge we have gathered from the higher-order function concept, we can easily guess what a high-order component will be and how it would be a good practice to use high-order components wherever we can. Since components are also functions which are called component in React world so High-order components are components which take either component as an argument or returns another component. Higher order components are JavaScript functions used for adding additional functionalities to the existing component.</p><p>Now that we have background knowledge of what Higher-order components are, its time to get hands our hands dirty and write some codes..;</p><p>Let’s consider building a react native application that will have two screens one to show a list of users and search functionality and the second screen to show the list of todos with search functionality.</p><p>The code for these two screens can be found below and the corresponding output.</p><p>Both components are functional components in both of them i have methods for the API call, and to render the corresponding results of the calls, I have also added input text for the search functionality and method to carry out the filtering process. They are as follows.</p><p>The first is the user listing:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/be56b98d2780d02e041fd4fbabbbb81a/href">https://medium.com/media/be56b98d2780d02e041fd4fbabbbb81a/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*mgPX9GS9dMHiY7b9pudMDA.gif" /></figure><p>The second is the todo listing:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8910d04e5d6f7ea3199898392cb610ed/href">https://medium.com/media/8910d04e5d6f7ea3199898392cb610ed/href</a></iframe><p>This was easy!!!</p><p>The problem in the above practice is that we are repeating a lot of the codes, we have the search functionality repeated in both modules, and this is where HOC comes in handy.</p><p>We will solve this problem by creating a SearchHOC module and having all those repeated logic in the module.</p><p>You can see we have moved all the filter logic and UI to the module because they are repeated. the next thing to do is to go and modify the user list and tools modules.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a8ec2e508e170b47226186d8055aeea9/href">https://medium.com/media/a8ec2e508e170b47226186d8055aeea9/href</a></iframe><p>You can see we have moved all the filter logic and UI to the module because they are repeated. the next thing to do is to go and modify the user-list and to-do list modules.</p><p>They will look like below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/43cd68c4786d1e3b76d440d4b0f0b988/href">https://medium.com/media/43cd68c4786d1e3b76d440d4b0f0b988/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*mgPX9GS9dMHiY7b9pudMDA.gif" /></figure><p>Todos:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89e9f9f821972a723a48f595f914c6ec/href">https://medium.com/media/89e9f9f821972a723a48f595f914c6ec/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*iRFhYVVqVJLOrXb3LecyeA.gif" /></figure><p>As you can see we have used the HOC class in our modules and they are a lot organized and clean and we still maintained the functionalities of the modules.</p><p>If you found this post helpful please press 💚 and 🐦</p><p>Also see Facebook’s official doc <a href="https://facebook.github.io/react/docs/higher-order-components.html">here</a>.</p><p>Now go explore more of HOC!! 🙌</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7233bdf7bbac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pure Components in React Native]]></title>
            <link>https://medium.com/@pechbusorg/pure-components-in-react-native-7c109ecefff5?source=rss-d23d754163df------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c109ecefff5</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react-components]]></category>
            <category><![CDATA[purecomponent]]></category>
            <dc:creator><![CDATA[Ayeni Ayobami]]></dc:creator>
            <pubDate>Sun, 17 Jul 2022 01:11:04 GMT</pubDate>
            <atom:updated>2022-07-17T01:11:04.976Z</atom:updated>
            <content:encoded><![CDATA[<p>By default, React will always re-render the component each time there is a change in state or props value.</p><p>Every time the state or props of a component change, the component have to no choice but to re-render, Even the component that is not involved in the changes that were made to the props or the state. We might think there is nothing wrong with that but when we have this experience in a lot of components in an application it begins to affect the performance of the application, like they say “Little drops of water,/Little grains of sand,/Make the mighty ocean/And the pleasant land”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*85PHWK1TVNhMCJjHjzeAgw.jpeg" /></figure><p>Now that I have clearly defined a problem what do you think? I am sure you will be asking how you can prevent a component from re-rendering when there is a state or prop change or at least minimize the re-rendering to the component involved in the change with the least amount of work.</p><p>The Solution is using Pure Component for components that are not involved in the change. Pure Component ?!!!! Yes, you are right Pure Component!!!!!</p><p>What are pure components?</p><p><strong>Pure Components</strong> in React are the components that do not re-render when the value of state and props has been updated with the same values. If the value of the previous state or props and the new state or props is the same, the component is not re-rendered. Pure Components restricts the re-rendering ensuring the higher performance of the Component</p><p>Let me show you an example.</p><p>Imagine you have an application that displays superheroes and if they are marvel characters or not:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b931e4a4827e504f0732788079a8988d/href">https://medium.com/media/b931e4a4827e504f0732788079a8988d/href</a></iframe><p>Next, you have a SuperHero component with the following content:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/455c830ce54484ace6483c9c7c347d33/href">https://medium.com/media/455c830ce54484ace6483c9c7c347d33/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*p1qsmprSPNjrINoOTrIJDg.gif" /><figcaption>output</figcaption></figure><p>When you change the isMarvel value by clicking on the button, you’ll find that SuperHero gets re-rendered because React-native will print the warning to the screen. When clearly non if the activities to change isMarvel involves it. SuperHero component doesn’t need to re-render.</p><p>To prevent the re-rendering and optimize your React app performance, you can extend the PureComponent class instead of Component:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1f22edc9a798d32a871aa48295c604a7/href">https://medium.com/media/1f22edc9a798d32a871aa48295c604a7/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*4wer4s1HZTwQYoRqwj9S1A.gif" /></figure><p>Now when you change the isMarvel value by clicking on the button, you won’t see React-native printing the warning because SuperHero will check the props and determine whether to render or not.</p><p><strong>For function-based PureComponent</strong></p><p>You can achieve the same with function-based components, but instead of extending the PureComponent class, you need to wrap the function component with React.memo(), which memoizes (cache) the output of the component.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ba081aa8514ecd55994719e07bbeb3c/href">https://medium.com/media/0ba081aa8514ecd55994719e07bbeb3c/href</a></iframe><p>React’s “pure component” is a performance optimization method that implements the shouldComponentUpdate method underneath, but you should only use it sparingly, or even none at all.</p><p>Hope you had a good read?…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c109ecefff5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>