<?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[Harsh Makadia's blog]]></title><description><![CDATA[Short and sweet articles on React, Javascript and No code world]]></description><link>https://harshmakadia.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 11:32:01 GMT</lastBuildDate><atom:link href="https://harshmakadia.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Props Drilling v/s Context API Which One Is the Best]]></title><description><![CDATA[Is shortcut i.e context API only the best? Prop drilling vs Context API, How the data is passed React was initially released in 2013 and one thing that…]]></description><link>https://harshmakadia.hashnode.dev/props-drilling-v-s-context-api-which-one-is-the-best-75c503d21a65</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/props-drilling-v-s-context-api-which-one-is-the-best-75c503d21a65</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Wed, 27 Jan 2021 11:02:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520124582/F7u4Ufc31.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Is shortcut i.e context API only the best?</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520119271/wP1z9dcS0.png" alt="Prop drilling vs Context API, How the data is passed" /><em>Prop drilling vs Context API, How the data is passed</em></p>
<p>React was initially released in 2013 and one thing that hasn’t changed so far is the way data is passed with props in the nesting level. But the good news is there are some other ways in which data can be passed to the child from the parent. Context API is especially useful when you have multiple levels of the nested child.</p>
<p>Let’s start with the basics to get more ideas about it.</p>
<h2 id="what-is-props">What is Props?</h2>
<p>React is a library that helps us divide the UI into small reusable pieces which we call a component. In order to pass data between the components, we make use of Props. Data is passed to the component with the help of props. 
Thus props help us pass the data from one component to another.</p>
<p>Now the data in props are read-only meaning it cannot be changed by the child who is consuming the data. Thus it is a unidirectional flow. (one way from parent to child). We can however pass data from child to parent making use of the function passing it via props.</p>
<h2 id="what-is-prop-drilling">What is Prop drilling?</h2>
<p>Prop drilling refers to the passing of the data from the parent to all the nested children in the React Tree. Let’s look at the diagram above on how data has to be passed from parents to all its child.</p>
<h2 id="when-can-prop-drilling-cause-a-problem">When can prop drilling cause a problem?</h2>
<p><strong>1. Updating data format</strong>
Let’s assume that you passed data to the nested child and now you want to refactor the data that is passed for example</p>
<pre><code>&lt;Profile <span class="hljs-keyword">user</span>="Harsh"&gt;
</code></pre><p>Let’s assume that we now need to pass an object as we also need to pass profile status if it’s expired or not. so here is how the component will look like</p>
<pre><code>&lt;Profile <span class="hljs-keyword">user</span>={"name": "Harsh", "status": "Expired"}
</code></pre><p>During such cases, you have to change the data format which is accessed by each of them.</p>
<p><strong>2. Renaming props
</strong>Let assume that later in the state of application there comes a time to rename the prop as you are removing some data or passing more. It has to be changed at all the places down the hierarchy.</p>
<p>Let’s take a look at how we can solve this problem by making use of React Context.</p>
<h2 id="react-context">React Context</h2>
<p>Context provides an awesome way to pass data through the component tree without having to pass props down manually at every level in your application.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520122013/KoycvL14O.png" alt /></p>
<h2 id="context-has-3-main-blocks">Context has 3 main blocks:</h2>
<h3 id="context-object">Context Object</h3>
<p>You can define the Context object in a separate file or right next to a component in a component file if you wish. Having multiple contexts within the component is also possible. Thus you can store any data you want in the context object which will be accessed globally in your application.</p>
<h3 id="context-provider">Context Provider</h3>
<p>The provider provides the values in all the components within the application that needs to access this context object.</p>
<h3 id="context-consumer">Context Consumer</h3>
<p>In the below example, the <strong><em>context </em></strong>is nothing but the values of the context object. All the values which we defined during creating the context object are easily accessed here. Yeah, it’s that easy!</p>
<h2 id="when-can-context-api-cause-a-problem">When can context API cause a problem?</h2>
<p>Unnecessary re-rendering in Application</p>
<blockquote>
<p>Everything that consumes a context re-renders everytime that context’s state changes.</p>
</blockquote>
<p>Though context API seems to be an amazing feature overusing it might lead to unnecessary re-rendering in your application whenever the state of the provider changes it will re-render all it’s the child no matter even if they are customing the data from the provider or not.</p>
<p><strong>Conclusion</strong></p>
<ul>
<li><p>Context API is always a good choice when the data stored does not have frequent updates like dark/light mode (theme), profile picture details, account details, etc.</p>
</li>
<li><p>React is already fast and doesn’t need many optimizations, Most of the case prop drilling can be also a good choice to consider as it is easy from an implementation perspective</p>
</li>
<li><p>Try to keep the state of the app as close as to the render component.</p>
</li>
<li><p>There is no proper guide on whether you should go with prop drilling or context API, Just validate your code in terms of necessity, whether it is required to do or no and then proceed.</p>
</li>
</ul>
<p>Happy Learning.</p>
]]></content:encoded></item><item><title><![CDATA[Build an MVP in a week by picking the right technology stack]]></title><description><![CDATA[Spend Less 💰, Ship Faster 🚀 On average a person has over 50,000 thoughts a day, Have you come across an idea which you think has the potential to…]]></description><link>https://harshmakadia.hashnode.dev/build-an-mvp-in-a-week-by-picking-the-right-technology-stack-aec0443aeab5</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/build-an-mvp-in-a-week-by-picking-the-right-technology-stack-aec0443aeab5</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Thu, 17 Sep 2020 08:14:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520326049/t7ueLAROL.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Spend Less 💰, Ship Faster 🚀</p>
<p>On average a person has over 50,000 thoughts a day, Have you come across an idea which you think has the potential to generate revenue? You always have a second thought I wish this could be done in some days so that I can launch it on <a target="_blank" href="https://www.producthunt.com/">Producthunt</a> and quickly evaluate it instead of wasting a lot of effort and money on this.</p>
<p><img src="https://cdn-images-1.medium.com/max/2244/1*9ZNDdF8254Tv8-H-sz81ZA.png" alt="Image from [undraw](https://cdn.hashnode.com/res/hashnode/image/upload/v1612520299755/EYFPwMvjw.html)" /><em>Image from <a target="_blank" href="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520309744/yRFdBz_0G.html">undraw</a></em></p>
<p>This article will throw some light on choosing the right MVP stack to quickly go to the market making use of all possible low code/ no-code tools. 
Let’s take look at the possible lifecycle which idea needs to pass through in order to release the MVP.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520301957/wee9KtHmH.png" alt="Idea lifecycle to MVP" /><em>Idea lifecycle to MVP</em></p>
<h2 id="what-is-mvp-minimum-viable-product">What is MVP (Minimum viable product)?</h2>
<p>MVP is the basic version of your product which you are having an idea of, it has only the required features that are helping solve the real-world problem instead of running behind all the features which an application should have. 
This product then evolves based on customer feedback and becomes more mature as time passes by.</p>
<h2 id="what-purpose-does-mvp-serve">What Purpose does MVP serve?</h2>
<ul>
<li><p>Budget is a key factor whenever we are planning to build some application, you are not sure if the idea which you have is really going to work</p>
</li>
<li><p>Reduce time to market</p>
</li>
<li><p>Quickly put your idea to test with a small budget</p>
</li>
<li><p>If things go haywire you are able to spot them early rather than building the complete product and then evaluating it.</p>
</li>
</ul>
<p>For the above lifecycle diagram, The major time which is spent is wasted on building things. Let’s take a look at how it can be reduced choosing the right so-called MVP stack. 🏆</p>
<h2 id="frontend-tools">Frontend Tools</h2>
<p>Gone are those days where a dev use to check the responsive behavior in different resolution, add custom CSS to make it responsive, starting a new project from scratch. What no-code tools can you use then?</p>
<p>Apart from choosing the UI kit libraries which help you get your job done like</p>
<ul>
<li><a target="_blank" href="https://semantic-ui.com/">Semantic UI</a></li>
<li><a target="_blank" href="https://chakra-ui.com/">Chakra UI</a></li>
<li><a target="_blank" href="https://material-ui.com/">Material UI</a></li>
<li><a target="_blank" href="https://getbootstrap.com/">Bootstrap</a>
You can level up your game which some of the tools mentioned below.</li>
</ul>
<h3 id="divjoyhttpsdivjoycom"><a target="_blank" href="https://divjoy.com">Divjoy</a></h3>
<p>It is a React code base generator that will help you set up all layout boilerplate in minutes using drag and drop. Oh did I mention you can also choose the stack you prefer?</p>
<p><img src="https://cdn-images-1.medium.com/max/4524/1*-52tWk_r5mgi0aulqIsaew.png" alt="Image from [Divjoy](https://cdn.hashnode.com/res/hashnode/image/upload/v1612520303890/ApykpGG3i.html)" /><em>Image from <a target="_blank" href="http://divjoy.com">Divjoy</a></em></p>
<p>This will handle all the boilerplate code starting from frontend to backend, marketing, analytics, payment integration, and lot more.</p>
<h3 id="uibakeryhttpscdnhashnodecomreshashnodeimageuploadv1612520305692r-hjqecaohtml"><a target="_blank" href="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520305692/R-HJqEcAO.html">**UIBakery</a>**</h3>
<p>Create full-fledged apps visually in minutes. No coding required just drag and drop the things you want from the store and you are done. what more do you expect?</p>
<p><img src="https://cdn-images-1.medium.com/max/5044/1*aMK4ABBu2zpiKl8gFQSWfg.png" alt="Image from [UIBakery](https://uibakery.io/)" /><em>Image from <a target="_blank" href="https://uibakery.io/">UIBakery</a></em></p>
<h3 id="webflowhttpscdnhashnodecomreshashnodeimageuploadv1612520308202hcoxij4jhtml"><a target="_blank" href="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520308202/hcOXij4j_.html">Webflow</a></h3>
<p>Building your landing page website would be faster like never before with webflow, codeless, and do more with this tool. This is a super-advanced version of WordPress which will save you time.</p>
<p><img src="https://cdn-images-1.medium.com/max/3572/1*6QF65AuAXfFxgxmPMKceqg.png" alt="Image from [webflow](http://webflow.com)" /><em>Image from <a target="_blank" href="http://webflow.com">webflow</a></em></p>
<h3 id="bonus">Bonus 💰</h3>
<p>Now that we have many options for the landing page &amp; website it’s time to get some illustration for the website.</p>
<p><img src="https://cdn-images-1.medium.com/max/2750/1*t6pdsBNzCkRqLcya5pj8Gw.png" alt="Image from [unDraw](http://undraw.co)" /><em>Image from <a target="_blank" href="http://undraw.co">unDraw</a></em>
<a target="_blank" href="https://undraw.co/"><strong>unDraw - Open source illustrations for any idea</strong>
<em>Browse now Created by Katerina Limpitsouni Create better designed websites, products and applications. Browse to find…</em>undraw.co</a>
<a target="_blank" href="https://blush.design/"><strong>Blush: Illustrations for everyone</strong>
<em>Blush makes it easy to add free illustrations to your designs. Play with fully customizable graphics made by artists…</em>blush.design</a></p>
<h2 id="backend-tools">Backend Tools</h2>
<p>With a lot of tools coming to market, the is no need to use a database like MySQL which consumes a lot of time for setting up, creating tables, deploying it. Instead, there are some other tools that you can use as backend and get rid of the setup.</p>
<h3 id="airtablehttpsairtablecom"><a target="_blank" href="https://airtable.com/">Airtable</a></h3>
<p>Airtable provides a mix of database and spreadsheet with a better approach to organize the data. In a single airtable base you can have multiple tables, maintain a relationship somewhat similar to a database.</p>
<p>It provides REST API out of the box which can be used to create, read update, delete records without writing a single line of code.</p>
<p><img src="https://cdn-images-1.medium.com/max/5744/1*NrqSz9eNjZTov8lyn9sIVw.png" alt="Image from A[irtable](https://cdn.hashnode.com/res/hashnode/image/upload/v1612520311881/Q3a6K41Ti.html)" /><em>Image from A<a target="_blank" href="http://airtable.com">irtable</a></em></p>
<p><strong>Features:</strong></p>
<ul>
<li><p>No code required to setup backend</p>
</li>
<li><p>Easy to update values manually if required</p>
</li>
<li><p>Free plans are sufficient for basic needs</p>
</li>
<li><p>Save time and focus on what matters the most</p>
</li>
</ul>
<h3 id="nocode-apihttpscdnhashnodecomreshashnodeimageuploadv1612520314587zqzvxe3zhtml"><a target="_blank" href="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520314587/ZqZvXE_3z.html">NoCode API</a></h3>
<p>If your use case in the MVP is with readily available apps integration i.e 3rd party apps integration you can go with this tool.</p>
<p><img src="https://cdn-images-1.medium.com/max/2704/1*H-1K22tcBc7KjfjufzkarA.png" alt="Image from [NocodeAPI](http://nocodeapi.com)" /><em>Image from <a target="_blank" href="http://nocodeapi.com">NocodeAPI</a></em></p>
<p><strong>Features:</strong></p>
<ul>
<li><p>Super easy to set up REST API without a single line of code</p>
</li>
<li><p>A mechanism to secure your token while accessing the data</p>
</li>
<li><p>Serverless, no worry about hosting</p>
</li>
<li><p>Easily connect 3rd API with your project</p>
</li>
</ul>
<h3 id="firebasehttpsfirebasegooglecom"><a target="_blank" href="https://firebase.google.com/">Firebase</a></h3>
<p>It provides all in one solution from authentication, hosting, cloud function, and a lot more, kind of all in one solution for backend with support for real-time events on DB. Most of its services are free and within your budget for the MVP.</p>
<p><img src="https://cdn-images-1.medium.com/max/3044/1*_R58bczsczuNAx7Ln1fldQ.png" alt="Image from [firebase](https://cdn.hashnode.com/res/hashnode/image/upload/v1612520317066/nchzBmgp1.html)" /><em>Image from <a target="_blank" href="http://firebase.com">firebase</a></em></p>
<p><strong>Features:</strong></p>
<ul>
<li><p>Real-time database</p>
</li>
<li><p>Email, Github, Facebook, and Google authentication.</p>
</li>
<li><p>Hosting service</p>
</li>
<li><p>Cloud function, no need to setup server for your backend</p>
</li>
<li><p>File storage</p>
</li>
</ul>
<h2 id="hosting-platforms">Hosting Platforms</h2>
<p>There are lots of hosting services available in the market, but some of them stand out well. Auto deployment to production is something everyone is looking for to avoid any kind of human errors during deployment.</p>
<h3 id="netlifyhttpscdnhashnodecomreshashnodeimageuploadv1612520318531hkn22xsilhtml"><a target="_blank" href="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520318531/hKN22XsIL.html">Netlify</a></h3>
<p>It is a very famous hosting service that helps you code your code repository and pull your source code to generate the build process for you without your involvement.</p>
<p><img src="https://cdn-images-1.medium.com/max/5080/1*o9uQgXk8-CUCp9SRhTao_Q.png" alt="Image from [Netlify](http://netlify.com)" /><em>Image from <a target="_blank" href="http://netlify.com">Netlify</a></em></p>
<p><strong>Features:</strong></p>
<ul>
<li><p>Customizable CI/CD workflow</p>
</li>
<li><p>Purchase your domain</p>
</li>
<li><p>Deploy multiple sites from a single repository</p>
</li>
<li><p>Speed up your development flow</p>
</li>
<li><p>Auto-preview your PR or branch</p>
</li>
<li><p>Built-in Analytics</p>
</li>
</ul>
<h2 id="workflow-automation-tools">Workflow Automation Tools</h2>
<p>While working with different events in your app there is some point in time where you need to push the events to some other apps/services so that you know what’s happening in your app once it is deployed. Whether it may be sending an email, slack post, or any other events writing custom code just consumes a hell lot of time, using some of the tools mentioned below will help you achieve app integration in minutes.</p>
<h3 id="zapierhttpscdnhashnodecomreshashnodeimageuploadv1612520320876rbxcg0lhtml"><a target="_blank" href="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520320876/_RbX_cg0l.html">Zapier</a></h3>
<p>Zapier is an automation application while helps to connect thousands of apps into workflows for your business to make your job easier. It helps to set up a custom trigger for any of the events that happen in your app and transfers the data to integrate the app inside zapier which is called Zap.</p>
<p>This is a completely no-code platform that helps you connect your app with a lot of other 3rd party apps with the readily available platform, thus saving time and helping you focus more on your business.</p>
<p><img src="https://cdn-images-1.medium.com/max/5000/1*oXHyt9Asf9wqKan7C78B1g.png" alt="Image from [zapier](http://zapier.com)" /><em>Image from <a target="_blank" href="http://zapier.com">zapier</a></em></p>
<h3 id="integromathttpscdnhashnodecomreshashnodeimageuploadv16125203238175zma78kbqhtml"><a target="_blank" href="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520323817/5Zma78kBQ.html">Integromat</a></h3>
<p>All the manually handled day to day processes can be automated using Integromat. Similar to Zapier even these tools have support for tons of apps and service which help you save time.</p>
<p><img src="https://cdn-images-1.medium.com/max/4936/1*YJnnaI-70Dy5sIv8qWtWXA.png" alt="Image from [Integromat](https://www.integromat.com/)" /><em>Image from <a target="_blank" href="https://www.integromat.com/">Integromat</a></em></p>
<p>These are some of the tools you can consider to save time. I hope this article helps you build a rapid prototype. Happy Learning! 💻 😀</p>
<h2 id="if-you-enjoyed-reading-this-you-may-also-enjoy-some-of-my-other-pieces">If you enjoyed reading this, you may also enjoy some of my other pieces:</h2>
<ul>
<li><p><a target="_blank" href="https://medium.com/better-programming/10-tips-and-tricks-to-boost-your-react-apps-performance-in-2020-9388159f6ebf">🏆 10 Tips and Tricks to Boost Your React App’s Performance in 2020</a></p>
</li>
<li><p><a target="_blank" href="https://medium.com/javascript-in-plain-english/lifecycle-methods-substitute-with-react-hooks-b173073052a">Replacing Lifecycle methods with React Hooks</a></p>
</li>
<li><p><a target="_blank" href="https://medium.com/better-programming/tips-to-level-up-your-javascript-and-react-skills-62bfbbb9b4d">Tips to Level Up Your JavaScript and React Skills</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[10 Tips and Tricks to Boost Your React App’s Performance in 2020]]></title><description><![CDATA[Faster apps, happier users Icons by Freepik on flaticon. There are different ways of solving the same problem when it comes to programming — whether it be…]]></description><link>https://harshmakadia.hashnode.dev/10-tips-and-tricks-to-boost-your-react-apps-performance-in-2020-9388159f6ebf</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/10-tips-and-tricks-to-boost-your-react-apps-performance-in-2020-9388159f6ebf</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Mon, 31 Aug 2020 17:24:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520347223/Uon-9izJFo.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Faster apps, happier users</p>
<p><img src="https://cdn-images-1.medium.com/max/4628/1*-QnCh603gbVipMpq2-QxaQ.png" alt="Icons by [Freepik](https://cdn.hashnode.com/res/hashnode/image/upload/v1612520333112/OlJgjSPvR.html) on [flaticon](https://www.flaticon.com/)." /><em>Icons by <a target="_blank" href="https://www.flaticon.com/authors/freepik">Freepik</a> on <a target="_blank" href="https://www.flaticon.com/">flaticon</a>.</em></p>
<p>There are different ways of solving the same problem when it comes to programming — whether it be JavaScript, React, Python, or any other language. When you look into someone else’s code, there is always something new that you can learn.</p>
<p>React is evolving day by day and there are various approaches that can be used to solve any problem that we face in our application. Let’s look at ten tips and tricks that will definitely help you while working with React. Think of these tricks mostly as performance boosters for your application.</p>
<h2 id="1-pause-console-debugger"><strong>1. Pause Console Debugger</strong></h2>
<p>You have surely come across a scenario where you want to debug the style of dropdown or something else that closes automatically when you try to right-click on the element and click on “Inspect element.”</p>
<p>Here is a simple solution:</p>
<ol>
<li><p>Open your console from a browser.</p>
</li>
<li><p>Type in the following command:</p>
</li>
</ol>
<pre><code><span class="hljs-built_in">setTimeout</span>(<span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> {<span class="hljs-keyword">debugger</span>;}, <span class="hljs-number">5000</span>)
</code></pre><ol>
<li>Then open the dropdown that you want to debug.</li>
</ol>
<h2 id="2-usestate-lazy-initialization-with-function">2. useState Lazy Initialization With Function</h2>
<p>There are times when we need to set the initial value of the state from some variable or from a function that returns a value.</p>
<p>Let’s take a look at the example below:</p>
<pre><code><span class="hljs-keyword">const</span> initialState = someFunctionThatCaluclatesValue(props)

<span class="hljs-keyword">const</span> [count, setCount] = React.useState(initialState)
</code></pre><p>Since our function is in the body, every time a re-render happens, this function is getting called even if its value is not required (we only need it during the initial render).</p>
<p>Let’s see how to lazy initialize <code>useState</code> with a function:</p>
<pre><code><span class="hljs-keyword">const</span> getInitialState = <span class="hljs-function">(<span class="hljs-params">props</span>) =&gt;</span> someFunctionThatCaluclatesValue(props)

<span class="hljs-keyword">const</span> [count, setCount] = React.useState(getInitialState)
</code></pre><p>Creating a function is very fast. React will only call the function when it needs the initial value (which is when the component is initially rendered). So even if the function is taking a lot of time, it will be slow on the initial render only. This is called “lazy initialization.” It’s a performance optimization.</p>
<p>Let’s look at this GIF to get an idea of what that looks like:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520335655/lCpslgbJz.gif" alt="Lazy function vs. ordinary function" /><em>Lazy function vs. ordinary function</em></p>
<p>To play around with the example above:</p>
<h2 id="3-making-use-of-custom-hooks">3. Making Use of Custom Hooks</h2>
<p>With hooks, we don’t have some facility that can help us get the callback as in the case of <code>setState</code>.</p>
<p>For example, we get the callback in the state. Once the state is set, we usually use the callback function:</p>
<pre><code><span class="hljs-keyword">this</span>.setState({
    <span class="hljs-string">"name"</span> : <span class="hljs-string">"Harsh"</span>
}, () =&gt; {
     <span class="hljs-comment">// Hey that state is set successfully what do you</span>
     <span class="hljs-comment">// want to do, I'm callback your friend 😄</span>
})
</code></pre><p>Let’s see how can we achieve similar behavior with a custom hook that gets called only when the state is changed and isn’t called during the initial render:</p>
<p>For more easy-to-understand hook recipes, check out <a target="_blank" href="https://twitter.com/gabe_ragland">Gabe Ragland</a>.
<a target="_blank" href="https://usehooks.com/"><strong>useHooks</strong>
<em>This hook makes it super easy to subscribe to data in your Firestore database without having to worry about state…</em>usehooks.com</a></p>
<h2 id="4-monitor-unnecessary-renders-in-your-applications">4. Monitor Unnecessary Renders in Your Applications</h2>
<p>One of the common problems we face is evaluating the necessary renders in your application that are having a bad impact on the performance.</p>
<p>There are different ways we can evaluate them to avoid unnecessary renders in minutes</p>
<h3 id="why-did-you-render">why-did-you-render</h3>
<p><img src="https://cdn-images-1.medium.com/max/4424/1*godtZ4RYy0FqXenYFEM1Ew.png" alt="Image credit: [GitHub](https://cdn.hashnode.com/res/hashnode/image/upload/v1612520339020/mbG70KMEd.html)." /><em>Image credit: <a target="_blank" href="https://github.com/welldone-software/why-did-you-render">GitHub</a>.</em></p>
<p>According to its documentation, <a target="_blank" href="https://github.com/welldone-software/why-did-you-render">why-did-you-render</a> “monkey patches React to notify you about avoidable re-renders.” This will display unnecessary renders that are happening in your application so that you can take action against them.</p>
<h3 id="react-devtools">React Devtools</h3>
<p>As noted by <a target="_blank" href="https://www.debugbear.com/blog/measuring-react-app-performance">DebugBear</a>:</p>
<blockquote>
<p><a target="_blank" href="https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en">“DevTools</a> give us a visualization of the performance of your app. To see this, ensure that you are running React in development mode, open DevTools in your browser, and then go to the “Performance” tab.
You can record the performance of your app from a point after the page has loaded or from the page load. There are two buttons in the top left corner of the DevTools dialog:”</p>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520340833/QulA9bbuc.png" alt="Start recording" /><em>Start recording</em></p>
<p>Once you stop recording, you will be able to see a graph showing different components that rendered and the time taken to render them.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520342414/hqTF0_cEp.png" alt="Rendering information" /><em>Rendering information</em></p>
<h2 id="5-using-reactmemo-and-usememo">5. Using React.memo and useMemo</h2>
<p>According to <a target="_blank" href="https://reactjs.org/docs/react-api.html">React's official documentation</a>:</p>
<blockquote>
<p>"<code>React.memo</code> is a higher-order component.
If your function component renders the same result given the same props, you can wrap it in a call to React. In some cases, memoizing the result will provide a performance boost. This means that React will skip rendering the component and reuse the last rendered result.”</p>
</blockquote>
<p><code>React.memo</code> does a shallow comparison out of the box and avoids rendering. A Stack Overflow user <a target="_blank" href="https://stackoverflow.com/questions/36084515/how-does-shallow-compare-work-in-react">defined a shallow comparison</a> as being “when the properties of the objects being compared are done using <code>===</code> or strict equality and will not conduct comparisons deeper into the properties.”</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520344812/WYjZ5M0SL.png" alt="This will result in re-rendering." /><em>This will result in re-rendering.</em></p>
<p><em>Note: In the example above, <code>true</code> means that the component will render again despite the values being the same.</em></p>
<p>But there are times when you need to do a deep comparison, meaning you want to compare the nested properties in an array of objects. How can we do that? Let’s jump into our next trick.</p>
<h2 id="6-deep-comparison-in-shouldcomponentupdate">6. Deep Comparison in shouldComponentUpdate</h2>
<p>As we saw in the example above, <code>React.memo</code> can only help you to avoid re-rendering if your values are simple. But if you have a nested array of objects, you cannot compare them right out of the box.</p>
<p>Use deep-equal:
<a target="_blank" href="https://www.npmjs.com/package/deep-equal"><strong>deep-equal</strong>
<em>Node's assert.deepEqual() algorithm as a standalone module. This module is around 46 times faster than wrapping…</em>www.npmjs.com</a></p>
<p>Compare two objects and return whether they are equal according to a recursive equality algorithm.</p>
<blockquote>
<p>“If <code>opts.strict</code> is <code>true</code>, use strict equality (<code>===</code>) to compare leaf nodes. The default is to use coercive equality (<code>==</code>) because that's how <code>assert.deepEqual()</code> works by default.” — <a target="_blank" href="https://github.com/inspect-js/node-deep-equal">deep-equal</a></p>
</blockquote>
<p><em>Note: There are many such packages that can help you compare two nested arrays of objects to avoid re-rendering via comparison.</em></p>
<h2 id="7-react-window">7. React Window</h2>
<p>Since most of the application has to do with rendering the data in the form of a list, when the list grows long, it’s like a poison is slowly entering your application and having a bad impact on the performance. It starts consuming a lot of memory in the browser as well. Since all the list items are in the DOM, there is a lag when you scroll the list.</p>
<p>How can we render only some parts of the items on the list that are currently visible on the screen then? Make use of React Window:
<a target="_blank" href="https://github.com/bvaughn/react-window"><strong>bvaughn/react-window</strong>
<em>React components for efficiently rendering large lists and tabular data React window works by only rendering part of a…</em>github.com</a></p>
<p>No matter the size of your list (e.g. 1,000 items), it will only display 20–30 items in the DOM depending on the size of your window, which is completely customizable and will boost performance!</p>
<h2 id="8-react-query">8. React Query</h2>
<p>With hooks for fetching, caching, and updating asynchronous data in React, managing server state is easier than ever before with React Query.</p>
<p>Here are the features listed on <a target="_blank" href="https://github.com/tannerlinsley/react-query">GitHub</a>:</p>
<ul>
<li><p>Transport/protocol/back-end agnostic data fetching (REST, GraphQL, promises, whatever!)</p>
</li>
<li><p>Auto Caching + Refetching (stale-while-revalidate, Window Refocus, Polling/Realtime)</p>
</li>
<li><p>Parallel + Dependent Queries</p>
</li>
<li><p>Mutations + Reactive Query Refetching</p>
</li>
<li><p>Multi-layer Cache + Automatic Garbage Collection</p>
</li>
<li><p>Paginated + Cursor-based Queries</p>
</li>
<li><p>Load-More + Infinite Scroll Queries w/ Scroll Recovery</p>
</li>
<li><p>Request Cancellation</p>
</li>
<li><p><a target="_blank" href="https://reactjs.org/docs/concurrent-mode-suspense.html">React Suspense</a> + Fetch-As-You-Render Query Prefetching</p>
</li>
<li><p><a target="_blank" href="https://github.com/tannerlinsley/react-query-devtools">Dedicated Devtools (React Query Devtools)</a></p>
</li>
</ul>
<p><a target="_blank" href="https://github.com/tannerlinsley/react-query"><strong>tannerlinsley/react-query</strong>
<em>Hooks for fetching, caching and updating asynchronous data in React Enjoy this library? Try the entire TanStack! React…</em>github.com</a></p>
<h2 id="9-lazy-loading-react-components-with-reactlazy-and-suspense">9. Lazy Loading React Components (With React.lazy and Suspense)</h2>
<h3 id="what-is-reactlazy">What is React.lazy( )?</h3>
<p>As written by <a target="_blank" href="https://blog.bitsrc.io/lazy-loading-react-components-with-react-lazy-and-suspense-f05c4cfde10c">Nwose Lotanna</a>, <code>React.lazy</code> is:</p>
<blockquote>
<p>“A new function in React that lets you load React components lazily through code splitting without help from any additional libraries. Lazy loading is the technique of rendering only needed or critical user interface items first, then quietly unrolling the non-critical items later.”</p>
</blockquote>
<h3 id="what-is-suspense">What is Suspense?</h3>
<blockquote>
<p>"<code>Suspense</code> is a component required by the lazy function that is basically used to wrap lazy components. Multiple lazy components can be wrapped with the help of the <code>Suspense</code> component. It also takes a fallback property that is going to accept the React elements you want to render as the lazy component is being loaded.” — <a target="_blank" href="https://blog.bitsrc.io/lazy-loading-react-components-with-react-lazy-and-suspense-f05c4cfde10c">Nwose Lotanna</a></p>
</blockquote>
<p>See the code to play around with this on <a target="_blank" href="https://codesandbox.io/s/react-lazy-suspense-n15rs">CodeSandbox</a>.</p>
<p>You can now identify any large components on a page in your application that only render on certain user interactions (like clicking a button, toggle, etc). Splitting these components will minimize your JavaScript payloads and help you increase performance.</p>
<h2 id="10-one-function-to-update-multiple-input-state-values">10. One Function to Update Multiple Input State Values</h2>
<p>This is the common use case of keeping the same function to update multiple input values. Most of us know about this approach that helps to reduce the code and get our job done. This is useful in case there are multiple inputs in a form:</p>
<h2 id="conclusion">Conclusion</h2>
<p>Did you know any of these tricks? Thanks for reading this article. I hope you learned something new!</p>
]]></content:encoded></item><item><title><![CDATA[Improving the UX of React apps with Skeleton/Content Loader]]></title><description><![CDATA[Get rid of loading mask as some places in your apps and replace it with content loaders for better user experience. Nowadays many of the apps prefer…]]></description><link>https://harshmakadia.hashnode.dev/improving-the-ux-of-react-apps-with-skeleton-content-loader-f094e7ada4b6</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/improving-the-ux-of-react-apps-with-skeleton-content-loader-f094e7ada4b6</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Sun, 19 Jul 2020 16:49:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520137348/cdkm7nsuq.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Get rid of loading mask as some places in your apps and replace it with content loaders for better user experience.</p>
<p>Nowadays many of the apps prefer content loading for better user experience let’s first find out what is skeleton loading?</p>
<p><img src="https://cdn-images-1.medium.com/max/2000/1*k4hiuaBtPRxcD2czVreyvA.png" alt="Icons made by [https://cdn.hashnode.com/res/hashnode/image/upload/v1612520133274/31loxhnbx.html](https://www.flaticon.com/authors/freepik)" /><em>Icons made by <a target="_blank" href="https://www.flaticon.com/authors/freepik">https://www.flaticon.com/authors/freepik</a></em></p>
<h3 id="skeletoncontent-loading-screen">Skeleton/Content Loading Screen</h3>
<p>A skeleton screen is a version of the UI that doesn’t contain actual content/Information but it contains a mimics of how the page will look like when the actual content is displayed. It means that it will display the actual shape of how the layout will appear when all the information is loaded on the screen.</p>
<p>These screens usually content the place holder for different types of elements on the screens like text, images, videos, etc.</p>
<h3 id="advantages-of-using-skeleton-screen">Advantages of Using Skeleton Screen</h3>
<p>Instead of showing an old school loading mask at the center of your page where it is hard for the user to continuously keep staring at the loader, the skeleton screen will sometimes hide your performance issues 🤪 and the user is definitely going to enjoy watching the loading screen.</p>
<ul>
<li><p>Content loader helps to mimic how your web/mobile app screen is going to look like even before loading</p>
</li>
<li><p>You can show loading for different types of elements like image, text, video or any other sections according to your content layout (A lot of tech companies display skeleton screens while their content loads to boost the UX.)</p>
</li>
<li><p>The goal is to design for a perception of decreased waiting time. Users if already aware of what’s next in the menu</p>
</li>
</ul>
<p>Now in order to give you more idea about the loader in you are still not convinced let’s have a look at the example below</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520135345/gWfDRkNvk.jpeg" alt="Skeleton screen of different apps" /><em>Skeleton screen of different apps</em></p>
<h3 id="how-to-achieve-this-using-react">How to achieve this using React?</h3>
<p>Good News, there are a lot of readily available packages that you can use out of the box. Below are some of the packages which you can try in your applications</p>
<ul>
<li><p><a target="_blank" href="https://danilowoz.com/create-content-loader/">react-content-loader</a> (136,118 weekly downloads, 9K 🌟)</p>
</li>
<li><p><a target="_blank" href="https://github.com/dvtng/react-loading-skeleton">react-loading-skeleton</a> (54,298 weekly downloads, 1.3K 🌟)</p>
</li>
<li><p><a target="_blank" href="https://github.com/buildo/react-placeholder">react-placeholder</a> (22,808 weekly downloads, 1.2K 🌟)</p>
</li>
</ul>
<h2 id="code-time"><strong>Code Time ⚡️</strong></h2>
<p>Now that we know the libraries which we can use to achieve such content loading let’s start looking at the code which we need to add in our application</p>
<h3 id="installation">Installation</h3>
<pre><code>npm <span class="hljs-selector-tag">i</span> react-<span class="hljs-attribute">content</span>-loader — save 

OR 

yarn add react-<span class="hljs-attribute">content</span>-loader
</code></pre><h3 id="usage">Usage</h3>
<ol>
<li>Using readily available presets</li>
</ol>
<pre><code><span class="hljs-keyword">import</span> ContentLoader, { Facebook } <span class="hljs-keyword">from</span> <span class="hljs-string">'react-content-loader'</span>

const MyLoader = <span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> &lt;ContentLoader /&gt;
const MyFacebookLoader = <span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> &lt;Facebook /&gt;
</code></pre><ol>
<li>Custom mode, see the <a target="_blank" href="https://danilowoz.github.io/create-react-content-loader/">online tool</a></li>
</ol>
<pre><code><span class="hljs-keyword">const</span> MyLoader = <span class="hljs-function">() =&gt;</span> (
 <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">ContentLoader</span> <span class="hljs-attr">viewBox</span>=<span class="hljs-string">”0</span> <span class="hljs-attr">0</span> <span class="hljs-attr">380</span> <span class="hljs-attr">70</span>"&gt;</span>
 {/* Only SVG shapes */} 
 <span class="hljs-tag">&lt;<span class="hljs-name">rect</span> <span class="hljs-attr">x</span>=<span class="hljs-string">”0</span>" <span class="hljs-attr">y</span>=<span class="hljs-string">”0</span>" <span class="hljs-attr">rx</span>=<span class="hljs-string">”5</span>" <span class="hljs-attr">ry</span>=<span class="hljs-string">”5</span>" <span class="hljs-attr">width</span>=<span class="hljs-string">”70</span>" <span class="hljs-attr">height</span>=<span class="hljs-string">”70</span>" /&gt;</span>
 <span class="hljs-tag">&lt;<span class="hljs-name">rect</span> <span class="hljs-attr">x</span>=<span class="hljs-string">”80</span>" <span class="hljs-attr">y</span>=<span class="hljs-string">”17</span>" <span class="hljs-attr">rx</span>=<span class="hljs-string">”4</span>" <span class="hljs-attr">ry</span>=<span class="hljs-string">”4</span>" <span class="hljs-attr">width</span>=<span class="hljs-string">”300</span>" <span class="hljs-attr">height</span>=<span class="hljs-string">”13</span>" /&gt;</span>
 <span class="hljs-tag">&lt;<span class="hljs-name">rect</span> <span class="hljs-attr">x</span>=<span class="hljs-string">”80</span>" <span class="hljs-attr">y</span>=<span class="hljs-string">”40</span>" <span class="hljs-attr">rx</span>=<span class="hljs-string">”3</span>" <span class="hljs-attr">ry</span>=<span class="hljs-string">”3</span>" <span class="hljs-attr">width</span>=<span class="hljs-string">”250</span>" <span class="hljs-attr">height</span>=<span class="hljs-string">”10</span>" /&gt;</span>
 <span class="hljs-tag">&lt;/<span class="hljs-name">ContentLoader</span>&gt;</span></span>
)
</code></pre><h3 id="demo-time">Demo Time 🧨</h3>
<p>Sandbox credits — <a target="_blank" href="https://codesandbox.io/u/shaunwallace">https://codesandbox.io/u/shaunwallace</a></p>
<p>Link to codesandbox — <a target="_blank" href="https://codesandbox.io/s/2wp1zoj09j">https://codesandbox.io/s/2wp1zoj09j</a></p>
<p>Happy Learning! 😄 💻</p>
]]></content:encoded></item><item><title><![CDATA[Managing States with Recoil in React Applications]]></title><description><![CDATA[Recoil is an experimental state management library for React apps. It provides several capabilities that are difficult to achieve with React alone while…]]></description><link>https://harshmakadia.hashnode.dev/manging-state-with-recoil-in-react-application-aecdbfd371b7</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/manging-state-with-recoil-in-react-application-aecdbfd371b7</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Tue, 19 May 2020 20:26:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520383724/qsLlbizKw.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Recoil is an experimental state management library for React apps. It provides several capabilities that are difficult to achieve with React alone while being compatible with the newest features of React.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520369899/YFW_RrZnt.png" alt="Recoil" /><em>Recoil</em></p>
<p>While working with react you might have noticed that are different ways to manage the global state management in React. Let’s take look at the options that we have:</p>
<h3 id="redux">Redux</h3>
<p>Redux is a predictable state container for JavaScript apps.
It is used by a lot of web apps these days, it allows us to have a global state, register components to it and they will re-render by themselves every time a value they registered to will change.</p>
<ul>
<li><p>Redux helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test.</p>
</li>
<li><p>Centralizing your application’s state and logic enables powerful capabilities like undo/redo, state persistence, and much more.</p>
</li>
<li><p>Redux works with any UI layer and has a large ecosystem of add-ons to fit your needs.</p>
</li>
</ul>
<p>Read more about Redux — <a target="_blank" href="https://redux.js.org/">https://redux.js.org/</a></p>
<h3 id="context-api">Context API</h3>
<p>Context API is another approach that devs take for better management of state within the application.</p>
<p>Context is designed to share data that can be considered “global” for a tree of React components, such as the current authenticated user, theme, or preferred language.</p>
<ul>
<li><p>Scalable from any range of application (small, mid, large)</p>
</li>
<li><p>Comparatively less complex than Redux</p>
</li>
<li><p>No need to pass data to the children at each level. Consumer component instance can access all the data provided by the Provider Component at any level.</p>
</li>
</ul>
<p>Read more about context API — <a target="_blank" href="https://reactjs.org/docs/context.html">https://reactjs.org/docs/context.html</a></p>
<h3 id="recoil">Recoil</h3>
<p>Now that we are already using to above two famous ways of adding global state to our application here comes something new i.e <strong>Recoil 🧨</strong></p>
<p>Recoil lets you create a data-flow graph that flows from atoms (shared state) through selectors (pure functions) and down into your React components.</p>
<ul>
<li><p><strong><em>Atoms</em></strong> are units of the state that components can subscribe to. 
They’re updateable and subscribable: when an atom is updated, each subscribed component is re-rendered with the new value. They can be created at runtime, too. Atoms can be used in place of the React local component state. If the same atom is used from multiple components, all those components share their state.</p>
</li>
<li><p><strong><em>Selectors</em></strong> transform this state either synchronously or asynchronously.
When these upstream atoms or selectors are updated, the selector function will be re-evaluated. Components can subscribe to selectors just like atoms, and will then be re-rendered when the selectors change.</p>
</li>
</ul>
<h3 id="demo-time">Demo Time 🚀</h3>
<p>Let’s try to understand this with a Demo example.</p>
<p>Consider we want to store user data upon login into our application and share between two components, &lt;Header /&gt; and &lt;Body /&gt;. Let’s say if we were to do this with the <strong><em>useState</em></strong> hook we would have to define the useState Hook at both the places i.e inside the <em>Header</em> and <em>Body</em> component we cannot differently share the same state with useState Hooks. But with Recoil, we can easily achieve this.</p>
<p>Let first define an atom which stores the logged-in user Data</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520371816/6ax72816v.png" alt="Defining atom" /><em>Defining atom</em></p>
<blockquote>
<p><strong>Note</strong>: Don’t worry about the code snippet, I’ve got your back covered by adding the entire source code below.</p>
</blockquote>
<p>In the above example, we have stored the object which has a <em>name</em> in it. It is stored inside our <em>loggedInUserData</em> atom.</p>
<p>Now consider we need to show this name in our <strong>&lt;Header /&gt;</strong> component which looks something like this with help of <strong>useRecoilState</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520374320/kf7xJMnHk.png" alt="Header component" /><em>Header component</em></p>
<p>And our <strong>&lt;Body /&gt;</strong> component looks something like this, which display the data from the same atom which is used in the header component again with help of <strong>useRecoilState</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520376357/mLVpu8nG2.png" alt /></p>
<p>The syntax might look quite similar to <strong><em>useState </em></strong>which we are already used to in react hooks.</p>
<p>Now here’s the magic 🎩,
As in the above example since the same state is shared between the 
<strong><em>&lt;Header /&gt;</em></strong> component and the <strong><em>&lt;Body /&gt;</em></strong> if you change the name of logged-in user from the <strong><em>&lt;Body /&gt;</em></strong> component, then it will change it globally performing or necessary re-renders to update the state.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520379573/DCafEpWqb.gif" alt="**GIF**: Clicking on button update the states of both component" /><strong>*GIF</strong>: Clicking on button update the states of both component*</p>
<p>Here is a link to codesandbox for the code —</p>
<p><a target="_blank" href="https://codesandbox.io/s/react-recoil-ehfkd?file=/src/App.js">https://codesandbox.io/s/react-recoil-ehfkd</a></p>
<p>There are some other terms that were not used in the demo but you should know about</p>
<h3 id="userecoilvaluestate">useRecoilValue(state)</h3>
<p>This is one of the important hooks in the Recoil API. This hook will just subscribe to the component to the given Recoil state, it is used to return the value of the given Recoil state.</p>
<h3 id="reference-and-links-to-learn">Reference and links to learn</h3>
<p>Recoil was announced at ReactEurope a few days back (14th May 2020) check about this video</p>
<p><a target="_blank" href="https://github.com/facebookexperimental/Recoil"><strong>facebookexperimental/Recoil</strong>
<em>Recoil is an experimental state management library for React apps. It provides several capabilities that are difficult…</em>github.com</a>
<a target="_blank" href="https://recoiljs.org/"><strong>Recoil</strong>
<em>A state management library for React Recoil works and thinks like React. Add some to your app and get fast and flexible…</em>recoiljs.org</a></p>
<p>Thus this was a quick example of how recoil can be used to maintain the shared state within different components.</p>
<p>Happy Learning! 💻 😄</p>
<h2 id="bitdev-or-a-cloud-component-hub">Bit.dev | A Cloud Component Hub</h2>
<p>Publish reusable React components from any codebase to a single component hub. Use <a target="_blank" href="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520382018/WypW4buZz.html/">**Bit</a>** to document, organize, and even keep track of component updates and usage.</p>
<p>Share components with your team to maximize code reuse, speed up delivery and build apps that scale.</p>
<p><img src="https://cdn-images-1.medium.com/max/2000/1*Nj2EzGOskF51B5AKuR-szw.gif" alt="Example: exploring React components published on [Bit.dev](https://bit.dev)" /><em>Example: exploring React components published on <a target="_blank" href="https://bit.dev">Bit.dev</a></em></p>
]]></content:encoded></item><item><title><![CDATA[Lifecycle methods substitute with React Hooks]]></title><description><![CDATA[Why use class component when you have hooks 🤩🧨 It’s been more than a year now since the release of Hooks. More devs are switching to Hooks implementation…]]></description><link>https://harshmakadia.hashnode.dev/lifecycle-methods-substitute-with-react-hooks-b173073052a</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/lifecycle-methods-substitute-with-react-hooks-b173073052a</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Sun, 26 Apr 2020 12:35:47 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520398174/k0w30DJM6.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Why use class component when you have hooks 🤩🧨</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520391325/NoktFUOu1.png" alt /></p>
<p>It’s been more than a year now since the release of Hooks. More devs are switching to Hooks implementation over classical class-based components. Even if the Hooks based implementation is difficult to understand at the beginning but it’s worth switching to Hooks at the end. 🎉</p>
<p>Before we start looking at the replacement method. Let’s look at the classic Lifecycle events which are used in React 16</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520393160/OfgFp1ebB.jpeg" alt="React 16 Lifecycle Methods" /><em>React 16 Lifecycle Methods</em></p>
<p>Lifecycle Image credits — <a target="_blank" href="https://twitter.com/dceddia">https://twitter.com/dceddia</a></p>
<p>Let’s have a look at each one of them and how it can be replaced.</p>
<h2 id="componentdidmount">componentDidMount( )</h2>
<p>This method is usually called when the component has finished rendering for the first time. It is only called once throughout the lifecycle once after the component has finished mounting.</p>
<p><strong><em>With Hooks:</em></strong></p>
<pre><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">MyExample</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">const</span> [count, setCount] = useState(<span class="hljs-number">0</span>);

  useEffect(<span class="hljs-function">() =&gt;</span> {
    <span class="hljs-built_in">document</span>.title = <span class="hljs-string">`You clicked <span class="hljs-subst">${count}</span> times`</span>;
  }, []); <span class="hljs-comment">// Pass an empty array to run only callback on mount only.</span>

  <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>You clicked {count} times<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{()</span> =&gt;</span> setCount(count + 1)}&gt;
        Click me
      <span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}
</code></pre><h2 id="componentdidupdate"><code>componentDidUpdate( )</code></h2>
<p>This method is called multiple times which the app lifecycle. It is invoked immediately after updating occurs. This method is not called for the initial render.</p>
<p>There are two ways to handle,</p>
<ol>
<li><strong>Call hooks on every render</strong>
As you can see if the below example the second argument in the hooks is blank meaning it will render every single time.</li>
</ol>
<pre><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">MyExample</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">const</span> [count, setCount] = useState(<span class="hljs-number">0</span>);

  useEffect(<span class="hljs-function">() =&gt;</span> {
    <span class="hljs-built_in">document</span>.title = <span class="hljs-string">`You clicked <span class="hljs-subst">${count}</span> times`</span>;
  }); <span class="hljs-comment">// No second argument, so run after every render.</span>

  <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>You clicked {count} times<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{()</span> =&gt;</span> setCount(count + 1)}&gt;
        Click me
      <span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}
</code></pre><p><strong>2. Call hooks when specific property (dependencies) are changed
</strong>With this implementation, we need to pass the second argument to useEffect and it will be automatically triggered whenever that dependency is changed.</p>
<p><strong><em>With Hooks:</em></strong></p>
<pre><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">MyExample</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">const</span> [count, setCount] = useState(<span class="hljs-number">0</span>);

  useEffect(<span class="hljs-function">() =&gt;</span> {
    <span class="hljs-built_in">document</span>.title = <span class="hljs-string">`You clicked <span class="hljs-subst">${count}</span> times`</span>;
  }, [count]);

  <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>You clicked {count} times<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{()</span> =&gt;</span> setCount(count + 1)}&gt;
        Click me
      <span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}
</code></pre><h2 id="componentwillunmount">ComponentWillUnmount( )</h2>
<p>As the name implies this method will be called when the component is unmounted and it will be called only once in the component’s lifecycle.</p>
<p><strong>*With Hooks:</strong>
*Return a callback in <code>useEffect</code>'s callback argument and it will be called before unmounting.</p>
<pre><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">MyExample</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">const</span> [count, setCount] = useState(<span class="hljs-number">0</span>);

  useEffect(<span class="hljs-function">() =&gt;</span> {
    <span class="hljs-comment">// It will be called before unmounting.</span>
    <span class="hljs-keyword">return</span> <span class="hljs-function">() =&gt;</span> {
      <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'componentWillUnmount!'</span>);
    };
  }, []);

  <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>You clicked {count} times<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{()</span> =&gt;</span> setCount(count + 1)}&gt;
        Click me
      <span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}
</code></pre><h2 id="shouldcomponentupdate"><code>shouldComponentUpdate( )</code></h2>
<p>By default this lifecycle method is called every time the component is going to render where you can return true/false whenever you have to render the component or avoid rendering.</p>
<p>But since Hooks can be only used in functional component, and functional component internally handles the shouldComponentUpdate( ) method for use. You can already achieve this on the component level using <code>React.PureComponent</code> or <code>React.memo</code>. For preventing rerendering of the child components.</p>
<p><strong>*With Hooks:</strong>
*By default, it will only shallowly compare complex objects in the props object. If you want control over the comparison, you can also provide a custom comparison function as the second argument.</p>
<pre><code><span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span>

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">areEqual</span>(<span class="hljs-params">prevProps, nextProps</span>) </span>{
  <span class="hljs-comment">/*
  return true if passing nextProps to render would return
  the same result as passing prevProps to render,
  otherwise return false
  */</span>
}

<span class="hljs-keyword">const</span> Weather = <span class="hljs-function">(<span class="hljs-params">{weather}</span>) =&gt;</span> {
    <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>{weather.city}<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>{weather.temperature}<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
             {console.log('Render')}
            <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> React.memo(Weather, areEqual)
</code></pre><h2 id="getderivedstatefromprops"><code>getDerivedStateFromProps( )</code></h2>
<p><code>getDerivedStateFromProps</code> is invoked right before calling the render method, both on the initial mount and on subsequent updates. It should return an object to update the state, or null to update nothing.</p>
<p><strong><em>with Hooks:</em></strong></p>
<pre><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">ScrollView</span>(<span class="hljs-params">{row}</span>) </span>{
  <span class="hljs-keyword">const</span> [isScrollingDown, setIsScrollingDown] = useState(<span class="hljs-literal">false</span>);
  <span class="hljs-keyword">const</span> [prevRow, setPrevRow] = useState(<span class="hljs-literal">null</span>);

  <span class="hljs-keyword">if</span> (row !== prevRow) {
    <span class="hljs-comment">// Row changed since last render. Update isScrollingDown.</span>
    setIsScrollingDown(prevRow !== <span class="hljs-literal">null</span> &amp;&amp; row &gt; prevRow);
    setPrevRow(row);
  }

  <span class="hljs-keyword">return</span> <span class="hljs-string">`Scrolling down: <span class="hljs-subst">${isScrollingDown}</span>`</span>;
}
</code></pre><p>Example reference — <a target="_blank" href="https://reactjs.org/docs/hooks-faq.html#how-do-i-implement-getderivedstatefromprops">https://reactjs.org/docs/hooks-faq.html#how-do-i-implement-getderivedstatefromprops</a></p>
<h2 id="no-lifecycle-method-replacement"><strong>No Lifecycle method replacement</strong></h2>
<p>Below are some of the methods that do not have any lifecycle method replacement for hooks according to the react documentation:</p>
<ol>
<li><p><strong>componentDidCatch ( )</strong></p>
</li>
<li><p><strong>getSnapshotBeforeUpdate( )</strong></p>
</li>
<li><p><strong>getDerivedStateFromError ( )</strong></p>
</li>
</ol>
<p>Here is a quick preview of all methods together</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520396038/uuSg16oB_.png" alt /></p>
<p>Thanks for reading this article. I hope you are all geared up to start replacing the classical class-based components into hooks based implementation.</p>
<p>Happy Learning! 💻 😄</p>
<h3 id="a-note-from-javascript-in-plain-english"><strong>A note from JavaScript In Plain English</strong></h3>
<p>We have launched three new publications! Show some love for our new publications by following them: <a target="_blank" href="https://medium.com/ai-in-plain-english">**AI in Plain English</a><strong>, [</strong>UX in Plain English](https://medium.com/ux-in-plain-english)<strong>, [</strong>Python in Plain English](https://medium.com/python-in-plain-english) **— thank you and keep learning!</p>
<p>We are also always interested in helping to promote quality content. If you have an article that you would like to submit to any of our publications, send us an email at <a target="_blank" href="mailto:submissions@plainenglish.io">**submissions@plainenglish.io</a> **with your Medium username and we will get you added as a writer. Also let us know which publication/s you want to be added to.</p>
]]></content:encoded></item><item><title><![CDATA[Tips to Level Up Your JavaScript and React Skills]]></title><description><![CDATA[Clean up your code and follow some best practices Image Credits — Every year, there are a ton of different updates on the libraries, frameworks, and…]]></description><link>https://harshmakadia.hashnode.dev/tips-to-level-up-your-javascript-and-react-skills-62bfbbb9b4d</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/tips-to-level-up-your-javascript-and-react-skills-62bfbbb9b4d</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Tue, 04 Feb 2020 19:55:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520420340/OoWbXr1Kk.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Clean up your code and follow some best practices</p>
<p><img src="https://cdn-images-1.medium.com/max/2000/1*C--vxGhLUtVAIsOUt4VuKA.png" alt="Image Credits — [https://cdn.hashnode.com/res/hashnode/image/upload/v1612520406236/lloXz8Lb7.html](https://www.freepik.com/)" /><em>Image Credits — <a target="_blank" href="https://www.freepik.com/">https://www.freepik.com/</a></em></p>
<p>Every year, there are a ton of different updates on the libraries, frameworks, and technical concepts that we use in our projects. Our goal as a good dev is to make the most of the new features to make our life easy.</p>
<p>Here are some of the small tips which I found useful while working with JavaScript and React, I hope you get to learn something new from this and can implement some of the tips while working with React/JavaScript.</p>
<h2 id="1-react-router-jsx-api">1. React Router JSX API</h2>
<p>I’m pretty sure everyone out there must be using <a target="_blank" href="https://reacttraining.com/react-router/">React Router</a> to maintain different routes within the application. But wait, did you know how to pass props to the route component?</p>
<p>Take a look at the below code snippet, instead of passing the component in the route you can pass the entire component with props while defining the route.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520408081/skUrgUZhe.jpeg" alt /></p>
<p>Read more:</p>
<h2 id="2-lazy-load-images-using-different-libraries">2. Lazy Load Images Using Different Libraries</h2>
<p>Did you know that with Chrome’s 76 version, it is now possible to lazy load the images without including <em>any</em> third-party libraries? Simply add the <code>loading</code> attribute to lazy-load resources.</p>
<p>Take a look at the below snippet:</p>
<pre><code><span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"image.png"</span> <span class="hljs-attr">loading</span>=<span class="hljs-string">"lazy"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">"…"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"200"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"200"</span>&gt;</span>
</code></pre><p>Read more:
<a target="_blank" href="https://web.dev/native-lazy-loading/"><strong>Native lazy-loading for the web</strong>
<em>This post covers the loading attribute and how it can be used to control the loading of images and iframes.</em>web.dev</a></p>
<h2 id="3-convert-number-to-string">3. Convert Number to String</h2>
<p>Wondering which is the faster and easier way to convert a number to a string?</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520409668/kopw9Bbbn.png" alt="Simply add a blank string" /><em>Simply add a blank string</em></p>
<p>This hack will automatically convert any number type into a string.</p>
<h2 id="4-fill-array">4. Fill Array</h2>
<p>While defining an array, if you want to fill it with some data then it’s pretty easy.</p>
<p>Just define the size of the array along with the property that you want to fill in. This is a simple trick that comes in handy when you want to define a non-empty array.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520411339/n6gNLcm8g.png" alt="Declaring array with values" /><em>Declaring array with values</em></p>
<h2 id="5-proper-data-structure-for-fast-access-to-data">5. Proper Data Structure for Fast Access to Data</h2>
<p>Did you know that storing your data in an array of an object is much slower when compared to using object keys (usually ID) as the key in the data structure?</p>
<p>It does not require any iteration, you will be able to fetch any record of your choice.</p>
<h2 id="6-optional-chaining">6. Optional Chaining</h2>
<p>Optional chaining in JavaScript really makes the developer’s job easy. This operator allows you to traverse through a nested object to get the value of variables without worrying if any of those will be undefined.</p>
<p>Let’s consider an example to get more of an idea about this:</p>
<pre><code>const person = {  
  <span class="hljs-type">name</span>: <span class="hljs-string">'John Doe'</span>,  
  device: {  
    <span class="hljs-type">name</span>: <span class="hljs-string">'iPhone 11 Pro'</span>  
  }  
};
</code></pre><p>Consider we have an object called <code>person</code>, now if I want to access the device name, the simple syntax would be something like:</p>
<pre><code>const deviceName = person.device.name;
</code></pre><p>If <code>device</code> is undefined or null in <code>person</code>, the JavaScript interpreter will throw an error. With the optional chaining operator, you can write:</p>
<pre><code>const deviceName = person?.device?.name;
</code></pre><p>If <code>deviceName</code> is undefined, the <code>deviceName</code> will be <code>null</code>. Thus, by using optional chaining if the property in the object isn’t present, you don’t have to handle it explicitly. Optional chaining is here to rescue you.</p>
<h2 id="7-use-of-suspenselist">7. Use of SuspenseList</h2>
<p>React 16.6 added <code>&amp;lt;Suspense&amp;gt;</code>, a component that lets you “wait” for some code to load and declaratively specify a loading state (like a spinner) while waiting.</p>
<p>Here’s a quick glimpse of what the code looks like:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520413058/tV9U3i9K0.png" alt /></p>
<p><code>SuspenseList</code> takes two props:</p>
<ul>
<li><p><code>**revealOrder</code>** (forward, backward, together) defines the order in which the <code>SuspenseList</code> children should be revealed.</p>
</li>
<li><p><code>together</code> reveals <em>all</em> of them when they’re ready, instead of one-by-one.</p>
</li>
<li><p><code>**tail</code>** (collapsed, hidden) dictates how unloaded items in a <code>SuspenseList</code> are shown.</p>
</li>
<li><p>By default, <code>SuspenseList</code> will show all fallbacks on the list.</p>
</li>
<li><p><code>collapsed</code> shows only the next fallback on the list.</p>
</li>
<li><p><code>hidden</code> doesn’t show any unloaded items.</p>
</li>
</ul>
<p>In short, <code>SuspenseList</code> can be used to load items, one at a time, in a defined order, or all together — for better user experience.</p>
<p>We can wrap multiple <code>&amp;lt;Suspense/&amp;gt;</code> inside the <code>&amp;lt;SuspenseList/&amp;gt;</code> Tag.</p>
<p>Example:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520415681/XFz8uJcPR.gif" alt="Lazy Load" /><em>Lazy Load</em></p>
<p>Example repo link:
<a target="_blank" href="https://github.com/Harshmakadia/react-suspenseList"><strong>Harshmakadia/react-suspenseList</strong>
<em>Demo example for suspense list ⚠️ SuspenseList is experimental feature that are not yet available in a stable release…</em>github.com</a></p>
<blockquote>
<p><strong>Note</strong>: This is experimental features that are <a target="_blank" href="https://reactjs.org/docs/concurrent-mode-adoption.html">not yet available</a> in a stable release.</p>
</blockquote>
<h2 id="8-add-dynamic-object-properties">8. Add Dynamic Object Properties</h2>
<p>While defining an object, there might be a situation where you need to define the object properties dynamically. Let’s look at the example below.</p>
<h2 id="9-switching-to-cra-20-from-cra-10">9. Switching to CRA 2.0 From CRA 1.0</h2>
<p>Wondering why?</p>
<h2 id="10-reducing-the-length-of-an-array">10. Reducing the Length of an Array</h2>
<p>Most of you might know this simple trick to reduce the array length. All you need to do is assign it a number to a specific number.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520418375/dj0E6jRsw.png" alt /></p>
<h2 id="11-styled-components">11. styled-components</h2>
<p><a target="_blank" href="https://www.styled-components.com/">Styled-components</a> effectively belong to the CSS-in-JS libraries that abstract the CSS to the component level using only JavaScript to describe styles.</p>
<p>They can be created via the ES6 template literal notation using back-ticks like so:</p>
<h2 id="12-cache-busting-a-react-app">12. Cache Busting a React App</h2>
<p>Have you ever come across a scenario where the new build is not updated on the single-page refresh or requires clear caching to reflect the new changes?</p>
<p><a target="_blank" href="https://dev.to/flexdinesh/cache-busting-a-react-app-22lk">This amazing blog</a> explains how to handle versioning in React.
<a target="_blank" href="https://dev.to/flexdinesh/cache-busting-a-react-app-22lk"><strong>Cache Busting a React App</strong>
<em>TL;DR - SemVer your app and generate a meta.json file on each build that won't be cached by the browser. Invalidate…</em>dev.to</a></p>
<p>Below are some tips to consider, they have nothing to do with the logic but they help make your job easy.</p>
<h2 id="13-create-presentations-with-react">13. Create Presentations With React</h2>
<p>React <a target="_blank" href="https://mdx-deck.jxnblk.com">MDX-based presentation decks</a>.</p>
<p><a target="_blank" href="https://revealjs.com/#/">Reveal.js</a> is another library that can be used to develop catchy presentations. It’s an HTML presentation framework.</p>
<h2 id="14-documentation-with-docz">14. Documentation With Docz</h2>
<p>Docz enables you to quickly create live-reloading, SEO-friendly, production-ready documentation sites with MDX and customize the look, feel, and behavior when required by leveraging <a target="_blank" href="https://www.gatsbyjs.org/">GatsbyJS</a> and Gatsby theme shadowing.
<a target="_blank" href="https://www.docz.site/"><strong>Docz</strong>
<em>It has never been so easy to document your things</em>www.docz.site</a></p>
<h2 id="15-free-images-and-illustrations">15. Free Images and Illustrations</h2>
<p>A collection of links for free stock photography, video, and illustration websites.
<a target="_blank" href="https://github.com/neutraltone/awesome-stock-resources"><strong>neutraltone/awesome-stock-resources</strong>
<em>A curated list of awesome stock photography, video and illustration websites. I try my best to maintain this repository…</em>github.com</a></p>
<p>Thanks for reading. These were some of the tips and tricks that I use in my day-to-day tasks.</p>
<p>Happy learning.</p>
]]></content:encoded></item><item><title><![CDATA[Mastering JS console.log like a Pro]]></title><description><![CDATA[Still, using only console.log( ) to debug? Well, there’s a lot more. JS CONSOLE Printing messages in the browser console have definitely come to rescue to…]]></description><link>https://harshmakadia.hashnode.dev/mastering-js-console-log-like-a-pro-1c634e6393f9</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/mastering-js-console-log-like-a-pro-1c634e6393f9</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Sat, 14 Dec 2019 11:58:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520293579/gPa_XYSAb.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Still, using only console.log( ) to debug? Well, there’s a lot more.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520267597/p1nBkAFu0.jpeg" alt="JS CONSOLE" /><em>JS CONSOLE</em></p>
<p>Printing messages in the browser console have definitely come to rescue to all the developers out there. c<strong><em>onsole.log( )</em></strong> messages are like medicines for most of your diseases while debugging some wired problems in your code.</p>
<p>Most of the devs out there are like —<em> Let’s print the message in the browser to know more about this issue</em>. I’m sure that I’m not the only one doing this. 🤪</p>
<blockquote>
<p>Debugging is like being the detective in a crime movie where you’re also the murderer — Filipe Fortes 🐛</p>
</blockquote>
<p>Apart from the most commonly used console.log( ) message to print the message in the browser there are plenty of different ways to make your debugging process a lot easier. Let’s take a look at them one by one with examples.</p>
<h2 id="consolelog-or-info-or-debug-or-warn-or-error">console.log( ) | info( ) | debug( ) | warn( ) | error( )</h2>
<p>These will directly print the raw string with appropriate color based on the type of event that is provided to them.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520269353/5_aL4nWiz.png" alt="console log/info/debug/warn/error" /><em>console log/info/debug/warn/error</em></p>
<h2 id="use-placeholders">Use placeholders</h2>
<p>There are different placeholders that can be used as listed below
<strong>%o</strong> — which takes an object, 
<strong>%s</strong> — which takes a string, and 
<strong>%d</strong> — which is for a decimal or integer</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520271140/2xUitOWB_.png" alt="placeholders" /><em>placeholders</em></p>
<h2 id="add-css-to-console-messages">Add CSS to console messages</h2>
<p>Do all of your console messages look the same? well, it won’t be the same from now on, make your logs look more catchy for what matters the most to you.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520273222/QVjZ5uVYN.png" alt="Messages with colors" /><em>Messages with colors</em></p>
<p>What to color only a specific word from the log message? Here you go 😄</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520275345/oTnYfHVy7.png" alt="highlighting specific word" /><em>highlighting specific word</em></p>
<h2 id="consoledir">console.dir( )</h2>
<p>Prints a JSON representation of the specified object.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520277081/yQ14AFccF.png" alt /></p>
<h2 id="html-elements-in-console">HTML elements in console</h2>
<p>Get the HTML elements in the console just like inspecting elements</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520278763/Dhj0yE62j.png" alt="HTML Elements" /><em>HTML Elements</em></p>
<h2 id="consoletable">console.table ( )</h2>
<p>Want to view JSON in a proper and easily understandable way?</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520280741/uMH3iYqKG.png" alt="Better visualization of an array of objects huh!" /><em>Better visualization of an array of objects huh!</em></p>
<h2 id="consolegroup-and-consolegroupend">console.group( ) &amp; console.groupEnd( )</h2>
<p>It is quite possible to group the messages with the console</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520282586/asbWbm3oN.png" alt="Grouping messages" /><em>Grouping messages</em></p>
<h2 id="consolecount">console.count( )</h2>
<p>This function logs the number of times that this particular call to <code>count()</code> has been called. This function takes an optional argument <code>label</code>.</p>
<p>If <code>label</code> is supplied, this function logs the number of times <code>count()</code> has been called with that particular <code>label</code>.</p>
<p>If <code>label</code> is omitted, the function logs the number of times <code>count()</code> has been called <strong>at this particular line</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520284215/bc0B2-pT1.png" alt="counter" /><em>counter</em></p>
<h2 id="consoleassert">console.assert( )</h2>
<p>This comes quite handy when you only want to print some selected logs i.e. it will only print the false argument. It does nothing at all if the first argument is true.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520285902/HE3_66plZ.png" alt="Assertion" /><em>Assertion</em></p>
<h2 id="consoletrace">console.trace( )</h2>
<p>This method displays a trace that shows how the code ended up at a certain point.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520287848/_GvhqeEIR.png" alt="Trace" /><em>Trace</em></p>
<h2 id="consoletime">console.time( )</h2>
<p>A dedicated function for tracking the time taken for actions, console.time() is a better way to track the microtime taken for JavaScript executions.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520289792/fxpCFeK7J.png" alt /></p>
<h2 id="consolememory">console.memory( )</h2>
<p>Wondering how our JavaScript applications are using browser memory?</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520291595/JaytkC51Z.png" alt="Memory" /><em>Memory</em></p>
<h2 id="consoleclear">console.clear( )</h2>
<p>This one is the last but not the least 😁, To clear all the above console messages which you’ve learned, It’s time to destroy them with clear() command</p>
<p>Here is the gist for all above snippets
Link — <a target="_blank" href="https://gist.github.com/Harshmakadia/fc25e56cb8f49145f4c9b3528f04215f">https://gist.github.com/Harshmakadia/fc25e56cb8f49145f4c9b3528f04215f</a></p>
<h2 id="if-you-enjoyed-reading-this-you-may-also-enjoy-some-of-my-other-pieces">If you enjoyed reading this, you may also enjoy some of my other pieces:</h2>
<ul>
<li><p><a target="_blank" href="https://medium.com/better-programming/10-tips-and-tricks-to-boost-your-react-apps-performance-in-2020-9388159f6ebf">🏆 10 Tips and Tricks to Boost Your React App’s Performance in 2020</a></p>
</li>
<li><p>🚀 <a target="_blank" href="https://medium.com/javascript-in-plain-english/lifecycle-methods-substitute-with-react-hooks-b173073052a">Replacing Lifecycle methods with React Hooks</a></p>
</li>
<li><p>🙌🏻 <a target="_blank" href="https://medium.com/better-programming/tips-to-level-up-your-javascript-and-react-skills-62bfbbb9b4d">Tips to Level Up Your JavaScript and React Skills</a></p>
</li>
</ul>
<p>Happy Learning! 💻 😀</p>
]]></content:encoded></item><item><title><![CDATA[Quick walkthrough to SuspenseList in React]]></title><description><![CDATA[SuspenseList React 16.6 added a &lt;Suspense&gt; component that lets you “wait” for some code to load and declaratively specify a loading state (like a…]]></description><link>https://harshmakadia.hashnode.dev/quick-walkthrough-to-suspenselist-in-react-b930d1ece892</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/quick-walkthrough-to-suspenselist-in-react-b930d1ece892</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Tue, 12 Nov 2019 16:49:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520169961/7rGy9HFEf.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>SuspenseList</p>
<p>React 16.6 added a <code>&amp;lt;Suspense&amp;gt;</code> component that lets you “<em>wait</em>” for some code to load and declaratively specify a loading state (like a spinner) while waiting.</p>
<p>Here’s a quick glimpse of how the code looks:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520164834/eDsAznxL1.png" alt="React Suspense" /><em>React Suspense</em></p>
<p>Suspense for Data Fetching is a new feature starting from React 16.6 that lets you use <code>&amp;lt;Suspense&amp;gt;</code> to <strong>explicitly “wait” for, well, anything.</strong> It can wait for images, scripts, or other asynchronous work along with Data Fetching.</p>
<h2 id="suspenselist">SuspenseList</h2>
<p>SuspenseList helps coordinate many components that can be suspended, by orchestrating the order in which these components are revealed to the user.</p>
<p><code>SuspenseList</code> takes two props:</p>
<ul>
<li><p><strong>revealOrder (forwards, backwards, together)</strong> defines the order in which the <code>SuspenseList</code> children should be revealed.</p>
</li>
<li><p><code>together</code> reveals <em>all</em> of them when they’re ready instead of one by one.</p>
</li>
<li><p><strong>tail (collapsed, hidden)</strong> dictates how unloaded items in a <code>SuspenseList</code> are shown.</p>
</li>
<li><p>By default, <code>SuspenseList</code> will show all fallbacks on the list.</p>
</li>
<li><p><code>collapsed</code> shows only the next fallback on the list.</p>
</li>
<li><p><code>hidden</code> doesn’t show any unloaded items.</p>
</li>
</ul>
<p>In short, <code>SuspenseList</code> can be used to load items, on at a time, in a defined order, or all together — for better user experience.</p>
<p>We can wrap multiple <code>&amp;lt;Suspense/&amp;gt;</code> inside <code>&amp;lt;SuspenseList/&amp;gt;</code> Tag.</p>
<p>Let’s Deep dive into the Demo example:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520167642/jDU02wdxT.gif" alt="SuspenseList Example" /><em>SuspenseList Example</em></p>
<p>In the above example, there is a div that displays a <strong>loader</strong>( ⌛️ ) until the <strong>apple</strong> ( 🍎 )emoji is loaded.</p>
<p>I’ve added a random <strong>setTimeout </strong>( 🕰 )<strong> </strong>to make the apple load at different time intervals. Thus the above example shows how we can use different props of SuspenseList to load items inside it according to our requirements.</p>
<blockquote>
<p>⚠️ SuspenseList is experimental feature that are <a target="_blank" href="https://reactjs.org/docs/concurrent-mode-adoption.html">not yet available</a> in a stable release. Don’t rely on experimental builds of React in production apps. These features may change significantly and without a warning before they become a part of React.</p>
</blockquote>
<h3 id="link-to-sandbox">Link to Sandbox</h3>
<p><strong>🔥Live Demo:</strong>
<a target="_blank" href="https://n3818.csb.app/"><strong>React App</strong>
<em>Edit description</em>n3818.csb.app</a></p>
<p><strong>🚀 Github Code:</strong>
<a target="_blank" href="https://github.com/Harshmakadia/react-suspenseList"><strong>Harshmakadia/react-suspenseList</strong>
<em>Demo example for suspense list ⚠️ SuspenseList is experimental feature that are not yet available in a stable release…</em>github.com</a></p>
<h3 id="link-to-suspense-documentation">Link 🔗 to Suspense Documentation —</h3>
<p><a target="_blank" href="https://reactjs.org/docs/concurrent-mode-suspense.html"><strong>Suspense for Data Fetching (Experimental) - React</strong>
<em>Caution: This page describes experimental features that are not yet available in a stable release. Don't rely on…</em>reactjs.org</a></p>
<p>Happy Learning! 😄 💻</p>
<h2 id="learn-more">Learn More</h2>
<p><a target="_blank" href="https://blog.bitsrc.io/how-to-easily-share-react-components-between-projects-3dd42149c09"><strong>How to Share React UI Components between Projects and Apps</strong>
<em>A simple guide to help you easily share and reuse React components across apps, to build faster and better.</em>blog.bitsrc.io</a>
<a target="_blank" href="https://blog.bitsrc.io/9-tools-and-libraries-to-boost-your-react-component-workflow-6ff4b49511c2"><strong>9 React Libraries and Tools to Master your Component Workflow</strong>
<em>9 React UI component libraries and tools to speed your workflow.</em>blog.bitsrc.io</a>
<a target="_blank" href="https://blog.bitsrc.io/5-ways-to-style-react-components-in-2019-30f1ccc2b5b"><strong>5 Ways to Style React Components in 2019</strong>
<em>Making sense of styling React components in 2019 in a short yet detailed review</em>blog.bitsrc.io</a></p>
]]></content:encoded></item><item><title><![CDATA[Making API calls with React Hooks]]></title><description><![CDATA[With the new updates coming up in the React library, it's indeed impossible to use all the new React features in your application. It’s been 6 months since…]]></description><link>https://harshmakadia.hashnode.dev/making-api-calls-with-react-hooks-748ebfc7de8c</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/making-api-calls-with-react-hooks-748ebfc7de8c</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Mon, 05 Aug 2019 14:06:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520363258/e0H_m4mpk.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>With the new updates coming up in the React library, it's indeed impossible to use all the new React features in your application. It’s been 6 months since the official release of React Hooks which was released with React 16.8.0 (February 6, 2019)</p>
<p>This article will help you take the baby steps in using React Hooks, it will explain all the basic approach which you can take to make the most out of this beautiful feature.</p>
<p><img src="https://cdn-images-1.medium.com/max/2048/1*7fOjnGrHXIwWXvaFzz7AFA.jpeg" alt="React Hooks [ Icon Credit — [wanicon](https://cdn.hashnode.com/res/hashnode/image/upload/v1612520355302/qiAvAVni9.html), [freepik](https://www.freepik.com/) ]" /><em>React Hooks [ Icon Credit — <a target="_blank" href="https://www.flaticon.com/authors/wanicon">wanicon</a>, <a target="_blank" href="https://www.freepik.com/">freepik</a> ]</em></p>
<p>Let’s start with Quick Introduction to React Hooks</p>
<p>Hooks are functions that let you “hook into” React state and lifecycle features from function components. Hooks don’t work in classes — they let you use React without classes.</p>
<h3 id="usestate">useState 😄</h3>
<p><code>useState</code> is a <em>Hook,</em> We call it inside a function component when we want to add some local state to it. The good thing about this is that the state will be preserved during re-rendering.</p>
<p><code>useState</code> returns a pair: the <strong><em>current state value</em></strong> and a <strong><em>function</em></strong> that lets you update your component. Calling a function will work similarly to <code>this.setState</code> where it will update the values of the state, except it will not merge old and new state.</p>
<h3 id="useeffect">useEffect 😄</h3>
<p>The Effect Hook, <code>useEffect</code> adds the ability to perform side effects from a function component.</p>
<p>The purpose of useEffect is similar to the purpose of Lifecycle methods in the class component like <code>componentDidMount</code> , <code>componentDidUpdate</code> and <code>componentWillUnMount</code></p>
<p>You can also decide when to re-render. Consider below the example where we have passed a count array after the useEffect.</p>
<pre><code>useEffect(<span class="hljs-function">() =&gt;</span> {
  <span class="hljs-built_in">document</span>.title = <span class="hljs-string">`You clicked <span class="hljs-subst">${count}</span> times`</span>;
}, [count]); <span class="hljs-comment">// Only re-run the effect if count changes</span>
</code></pre><p>Let’s consider if the count value is 60 and if the component re-renders with the count value being unchanged i.e. 60, React will compare the previous render value and decide whether to call effect or not. If values are different then only the effect is called. Now that’s a way to increase performance and avoid unnecessary calls. 💯 🚀</p>
<p>If there are multiple items in the array, React will re-run the effect even if just one of them is different.</p>
<h3 id="converting-class-component-into-a-functional-component-with-hooks">Converting Class Component into a Functional Component with Hooks ⚖️</h3>
<p>Let’s look at the example of how we can get the same behavior as a class component in a function component using Hooks.</p>
<p><strong><em>Example:</em></strong> Consider an example where you need to make API calls and fetch the data and populate in our component and clicking on the <em>load</em> more button would fetch more data from the server.</p>
<p>Until the Release of React 16.8.0(Hooks), it wasn't possible to achieve these using functional components as lifecycle methods aren’t accessible in the functional component and it wasn’t possible to manage the state inside a functional component.</p>
<p>For making API calls we will use Github APIs <a target="_blank" href="https://developer.github.com/v3/search/#search-commits">https://developer.github.com/v3/search/#search-commits</a></p>
<p>Here is what a typical React code looks like for both ordinary class component and functional component using Hooks.</p>
<p><img src="https://cdn-images-1.medium.com/max/3576/1*e58rQldTQyOijWVWQtp8wQ.png" alt="API call code [ Icon Credit — R[oundicons](https://cdn.hashnode.com/res/hashnode/image/upload/v1612520358065/qXT56MhzH.html) ]" /><em>API call code [ Icon Credit — R<a target="_blank" href="https://www.flaticon.com/authors/roundicons">oundicons</a> ]</em></p>
<p>Whenever API calls are involved we need multiple state values —</p>
<ul>
<li><p>Holding that data that is to be rendered</p>
</li>
<li><p>Page count to make API call</p>
</li>
<li><p>Loading state (show loading screen/component until the data is received from server)</p>
</li>
<li><p>Error state (show error message when something goes wrong while fetching data)</p>
</li>
</ul>
<p>Thus above image with Class component and the functional component does the same thing of loading the commits from the Github. Thus this simple example will help you understand how easy it is to start using hook into your application. With hooks, you can use write code neatly and sort.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520360518/I76lEzJqz.gif" alt="API Calls with React Hooks" /><em>API Calls with React Hooks</em></p>
<p><strong>Code Snippet
 —</strong> Class Component API calling Code</p>
<p>— Hooks API calling Code</p>
<p><strong>Links to Live Demo</strong>
<a target="_blank" href="https://codesandbox.io/embed/class-component-api-calls-bwg4n"><strong>Class Component API calls - CodeSandbox</strong>
<em>CodeSandbox is an online editor tailored for web applications.</em>codesandbox.io</a></p>
<p><a target="_blank" href="https://codesandbox.io/s/functional-component-api-calls-qgho3">https://codesandbox.io/s/functional-component-api-calls-qgho3</a></p>
<p>Here are the rules you should keep in mind while working with React Hooks</p>
<ol>
<li><p>Don’t try to convert the old code written in class components into Hooks. However, it is recommended you can try using Hooks in the new implementation</p>
</li>
<li><p><a target="_blank" href="https://reactjs.org/docs/hooks-overview.html#state-hook">useState</a> and <a target="_blank" href="https://reactjs.org/docs/hooks-overview.html#effect-hook">useEffect </a>are the two new concepts which you should know to master Hooks</p>
</li>
<li><p>Only call Hooks <strong>at the top level</strong>. Don’t call Hooks inside loops, conditions, or nested functions.</p>
</li>
<li><p>Only call Hooks <strong>from React function components</strong>. Don’t call Hooks from regular JavaScript functions.</p>
</li>
</ol>
<p>Thus this is how React Hooks can be useful in making API calls, sometimes we have to convert a functional component into a class component only because of not being able to manage the state inside the functional component.</p>
<p><strong>Reference</strong></p>
<ul>
<li><a target="_blank" href="https://reactjs.org/">https://reactjs.org/</a></li>
</ul>
<p>Happy Learning 💻 😄</p>
<h3 id="the-platform-for-component-driven-development">THE PLATFORM FOR COMPONENT DRIVEN DEVELOPMENT</h3>
<p>If building with React, try <a target="_blank" href="https://bit.dev">**Bit</a>** — the platform for modern components.</p>
<p>It makes it easy &amp; simple to build modular components, reuse them with your team and between applications, collaborate on updates, and stay in sync.</p>
<p>Bit helps teams make sure they can reuse components together, share them between projects, and always keep everything consistent for users. If your team is seeking a way to share components or working on a great UI library, you should definitely check out Bit — and <a target="_blank" href="https://bit.dev">try it</a> for free.
<a target="_blank" href="https://github.com/teambit/bit"><strong>teambit/bit</strong>
<em>Documentation </em> Tutorials <em> Quick start guide </em> Workflows <em> bit.dev components cloud </em> Video demo Bit is an open-source…*github.com</a></p>
<h2 id="related-stories">Related Stories</h2>
<p><a target="_blank" href="https://blog.bitsrc.io/5-tools-for-faster-development-in-react-676f134050f2"><strong>5 Tools for Faster Development in React</strong>
<em>5 tools to speed the development of your React application, focusing on components.</em>blog.bitsrc.io</a>
<a target="_blank" href="https://blog.bitsrc.io/11-react-ui-component-playgrounds-for-2018-eef5a87a1bf8"><strong>11 React UI Component Playgrounds for 2019</strong>
<em>Useful online playgrounds and editors for your UI components</em>blog.bitsrc.io</a>
<a target="_blank" href="https://blog.bitsrc.io/how-to-easily-share-and-consume-react-components-using-bit-f53fb9463105"><strong>How to Easily Share and Consume React Components Using Bit</strong>
<em>Learn how to easily create, share and consume react components with the awesome power of Bit</em>blog.bitsrc.io</a></p>
]]></content:encoded></item><item><title><![CDATA[How Robotics Process Automation(RPA) helped to automate the inbound Leads]]></title><description><![CDATA[Robotic process automation (RPA) is the use of software with artificial intelligence (AI) and machine learning capabilities to handle repetitive tasks that…]]></description><link>https://harshmakadia.hashnode.dev/how-robotics-process-automation-rpa-helped-to-automate-the-inbound-leads-9c459f781dc0</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/how-robotics-process-automation-rpa-helped-to-automate-the-inbound-leads-9c459f781dc0</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Sun, 23 Jun 2019 20:01:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520186243/a1majbFup.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Robotic process automation (RPA) is the use of software with artificial intelligence (AI) and machine learning capabilities to handle repetitive tasks that previously required humans to perform.</p>
<p>RPA evolved from three key technologies: screen scraping, workflow automation, and artificial intelligence.
<a target="_blank" href="https://www.datadriveninvestor.com/2018/10/20/fintech-startups-are-disrupting-the-banking-industry-around-the-world/"><strong>Fintech Startups are disrupting the Banking Industry around the World - Data Driven Investor</strong>
<em>Traditional brick &amp; mortar banks have never really recovered from the major set back they received after the financial…</em>www.datadriveninvestor.com</a></p>
<blockquote>
<p>There are different tools available to perform automation like UiPath, Automation Anywhere, Blue Prism, WorkFusion and lot more.</p>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520176645/U2VXRIbcY.png" alt="Welcome to the world of automation" /><em>Welcome to the world of automation</em></p>
<h2 id="lead-scoring-is-a-methodology-used-to-rank-prospects-against-a-scale-that-represents-the-perceived-value-each-lead-represents-to-the-organization">Lead scoring is a methodology used to rank prospects against a scale that represents the perceived value each lead represents to the organization.</h2>
<p>Lead scoring helps the marketing team to prioritize the follow-up activities with the prospects. Here is a simple case study of how I automated lead scoring based on different types of factor to find out whether the lead is good enough to be approached using UiPath.</p>
<p><strong>Goal:</strong></p>
<blockquote>
<p>RPA performed to get all the details of the user who had downloaded content from the website Or filled up contact-us form. Automation performed to get details about the lead current position, year of experience company strength, revenue, location, etc to check if it is a hot lead.</p>
</blockquote>
<p>Below diagram gives a quick overview of different steps involved in the automation in order to process the inbound lead.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520178971/Pc5_22TcR.png" alt="RPA workflow to process leads" /><em>RPA workflow to process leads</em></p>
<p>Following steps were performed using robotics process automation</p>
<ol>
<li>When the user downloads some content from the website like e-book/case studies or fills up contact us form an email is received to the company with the basics details of the user like <strong><em>name, email address, designation</em></strong>.</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520180774/HvfUZEi0A.png" alt="Details that are received in the email received" /><em>Details that are received in the email received</em></p>
<ol>
<li><p>Lead scoring is nothing but giving a score to the user who downloaded the content from the website based on different factors like designation, company name, location, year of existence, company revenue, etc.</p>
</li>
<li><p>A sheet with all the type of scoring details is giving as an input to find out the actual score.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520182477/aGPMbhUEc.png" alt="Config sheet for calculating the lead score" /><em>Config sheet for calculating the lead score</em></p>
<ol>
<li><p>RPA robot reads email, parse all the required details</p>
</li>
<li><p>Tries to find the LinkedIn profile of the user from the email address provided at the time of download.</p>
</li>
<li><p>Get all the important details from the LinkedIn profile like education background, current job position, years of experience, location, company name</p>
</li>
<li><p>Find the details about the company using LinkedIn to find out the employee strength, what is company expertise in doing</p>
</li>
<li><p>Finds the details about the Twitter profile to check if twitter handle is active, gets last tweet time, followers and following of the handle</p>
</li>
<li><p>Try to find out company revenue making use of third party website and gather necessary details</p>
</li>
<li><p>Gather all these details in the CSV file to better understand about the lead</p>
</li>
<li><p>Send emails back to the marketing team to take better decision on follow up emails etc.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520184599/ACc7pmx_P.png" alt="The email send back after automation performed has following fields" /><em>The email send back after automation performed has following fields</em></p>
<p>Thus this is how RPA saved a lot of human time/effort that was required to process all the leads manually and take action. Now with the automation marketing team can spend their time in other productive tasks. This is just a small use-case of how things can be automated, However, RPA can be used in lot more complex scenarios too.</p>
<p>There is no doubt on this, Robotics Process Automation will be a blessing for all the businesses in the coming year saving a lot of time and human effort.</p>
<p><strong><em>Welcome to the world of automation</em></strong></p>
<p>Happy Learning 💻 😄</p>
]]></content:encoded></item><item><title><![CDATA[How React Context can come to the rescue if you don’t know Redux]]></title><description><![CDATA[React Context React has become a fuzzword in front end development over the past few years. React is getting stronger and stronger with the new updates…]]></description><link>https://harshmakadia.hashnode.dev/how-react-context-can-come-to-the-rescue-if-you-dont-know-redux-5452464642ee</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/how-react-context-can-come-to-the-rescue-if-you-dont-know-redux-5452464642ee</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Thu, 14 Mar 2019 16:16:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520435309/-wqBCllJ7.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>React Context</p>
<p>React has become a <em>fuzzword</em> in front end development over the past few years. React is getting stronger and stronger with the new updates rolling out. This article will help you learn about React Context, which is a pure blessing for developers struggling with Data management between multiple components.</p>
<h2 id="wait-what-does-redux-do">Wait what does REDUX do?</h2>
<p>Redux is an open-source JavaScript library for managing application state. It is most commonly used with libraries such as React or Angular for building user interfaces.</p>
<blockquote>
<p>In short, Redux helps to maintain a global state which can be accessed throughout the application.</p>
</blockquote>
<p>Here is how typical redux works:</p>
<p><img src="https://cdn-images-1.medium.com/max/2000/1*51bqK6voIDkd0DY2RrmpGg.png" alt="Redux Workflow (Image credits — [The New Boston](https://cdn.hashnode.com/res/hashnode/image/upload/v1612520426939/jtGsp8ppo.html))" /><em>Redux Workflow (Image credits — <a target="_blank" href="https://www.youtube.com/user/thenewboston">The New Boston</a>)</em></p>
<p>Whoa whoa, that escalated quickly. What just happened? There are a lot of concepts to learn about in redux like <strong><em>Store, Action, </em></strong>and <strong><em>Reducers</em></strong>. But there is no need to learn all these things. You can do similar things with React Context. Wondering how?</p>
<h2 id="introducing-react-context">Introducing React Context</h2>
<h3 id="what-is-context">What is context?</h3>
<p>Context provides an awesome way to pass data through the component tree without having to pass props down manually at every level in your application.</p>
<p>Until React 15, you could only make use of props to pass the values from the parent to the child component. But there is a lot beyond that: what do you do when you need to pass data between pages (different routes) within the application?</p>
<p>You have to either make use of redux or local storage, using cookies within the browser. Context solves all those problems. Context provides a way to share values like these between the components without having to explicitly pass a prop through every level of the tree within the application.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520428793/yOqbI17Ih.png" alt="Main blocks of React Context" /><em>Main blocks of React Context</em></p>
<h3 id="context-has-3-main-blocks">Context has 3 main blocks:</h3>
<ol>
<li><p><a target="_blank" href="https://reactjs.org/docs/context.html#reactcreatecontext">A context Object</a></p>
</li>
<li><p><a target="_blank" href="https://reactjs.org/docs/context.html#contextprovider">A context Provider</a></p>
</li>
<li><p><a target="_blank" href="https://reactjs.org/docs/context.html#contextconsumer">A context Consumer</a></p>
</li>
</ol>
<p>Let’s try to solve a real-world scenario with context. Assume we want to create an application where products can be added to a cart. There are two pages (routes): one which displays the list of products, and the other which displays items in your cart.</p>
<p>If you were using only react without redux, it would become difficult to manage the state. We will look into how we can use <strong>context</strong> to manage the global state.</p>
<p><a target="_blank" href="https://react-context.netlify.com/">**Live Demo</a>**</p>
<p><img src="https://cdn-images-1.medium.com/max/5748/1*AX3ExlVjwNVMRaUpy7Sj7w.gif" alt="Products and Cart Page ([Demo inspiration](https://cdn.hashnode.com/res/hashnode/image/upload/v1612520431664/1krLhYsyZ.html))" /><em>Products and Cart Page (<a target="_blank" href="https://academind.com/learn/react/redux-vs-context-api/#what-is-redux">Demo inspiration</a>)</em></p>
<p>The entire source code can be found <a target="_blank" href="https://github.com/Harshmakadia/react-context-vs-redux">here</a>.</p>
<p>As you can see in the about example, there are two different components and the data has to be shared among both the components — a kind of global data.</p>
<h3 id="context-object">Context Object</h3>
<p>You can define the Context object in a separate file or right next to a component in a component file if you wish. Having multiple contexts within the component is also possible. Thus you can store any data you want in the context object which will be accessed globally in your application.</p>
<p>I’ve added Products and cart in the context object. Now it’s time to supply this context to all the components in the application which need to access this data.</p>
<h3 id="context-provider">Context Provider</h3>
<p>The provider provides the values in all the components within the application that needs to access this context object.</p>
<p>As shown above, this is how the context is passed. However, you can render any components within the 
<strong><em>&lt;ShopContext.Provider&gt;&lt;/ShopContext.Provider&gt;</em></strong></p>
<blockquote>
<p>Whatever child component is wrapped inside the <strong>ShopContext</strong> will be able to access the context object.</p>
</blockquote>
<p>Now that we have supplied the values, it’s time to access them with the consumer.</p>
<h3 id="context-consumer">Context Consumer</h3>
<p>There are two ways in which the data can be accessed:</p>
<ol>
<li><p>Using Context.Consumer</p>
</li>
<li><p>Using static contextType</p>
</li>
</ol>
<p><strong>Using Context.Consumer:</strong></p>
<p>In the above example, the <strong><em>context </em></strong>is nothing but the values of the context object. All the values which we defined during creating the context object are easily accessed here. Yeah, it’s that easy!</p>
<h3 id="using-static-contexttype">Using static contextType</h3>
<p>This is a simple way of how context can be accessed with contextType. Using <strong><em>this.context</em></strong> you can access the entire context object similar to that of context Consumer.</p>
<p>So far what we have seen in the example is about passing the data and accessing it. Let’s look into how to update the context Object.</p>
<h3 id="updating-context-object">Updating Context Object</h3>
<p>Updating context state is pretty easy, like how we update the values in the state normally. We have to pass a method from the component which will be used to update the values in that state of context. Once the values are updated via setState, it will automatically render the new values in all the components where the context object is being consumed. No rocket science 🚀 here!</p>
<p>The above two methods are how we usually pass a function from the child component to parent component while working with React.</p>
<p>In the above code snippet, <strong><em>addProductToCart</em></strong> and <strong><em>removeProductFromCart</em></strong> are the two methods that will be used to add/update values inside the context.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520433432/UHKjSchWw.png" alt="You are all set to use React Context Now!" /><em>You are all set to use React Context Now!</em></p>
<h2 id="but-will-context-replace-redux">But will Context replace Redux 🤔?</h2>
<ul>
<li><p>Context is a clear win when you need to update the values rarely, like storing user objects upon login, language preference, theme colors and so on (as these do not trigger the updates more frequently)</p>
</li>
<li><p>Context seems to be simple compared to redux, but you shouldn’t use it where the values update more frequently. It is not optimized for that.</p>
</li>
<li><p>Adding Redux to your project brings more dependency packages with them, increasing the bundle size, while context can be used out of the box with React.</p>
</li>
</ul>
<p>Thus from the above points, Context can definitely be used for low-frequency updates but is not recommended for general state management.</p>
<p>I hope in the coming updates that context becomes more powerful and is ready to fully use for state management 💪 🏋.</p>
<p>Happy Learning! 💻 😄</p>
]]></content:encoded></item><item><title><![CDATA[Deploy React Application using Docker and Google Cloud Platform]]></title><description><![CDATA[Docker | ReactJS | GCP In this article, you will learn how to deploy applications on GCP. We will deploy a create-react-app. Link to the Repo —]]></description><link>https://harshmakadia.hashnode.dev/deploy-react-application-using-docker-and-google-cloud-platform-4bc03f9ee1f</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/deploy-react-application-using-docker-and-google-cloud-platform-4bc03f9ee1f</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Tue, 05 Feb 2019 03:36:02 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520498993/PkJj6LEta.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Docker | ReactJS | GCP</p>
<p>In this article, you will learn how to deploy applications on GCP. We will deploy a create-react-app.</p>
<p>Link to the Repo — <a target="_blank" href="https://github.com/Harshmakadia/react-docker">https://github.com/Harshmakadia/react-docker</a></p>
<p>Before we get started with the actual steps of deploying the React App using GCP and <a target="_blank" href="https://hackernoon.com/tagged/docker">Docker</a>. First, <em>let’s understand what docker actual is?</em></p>
<p>Docker is a tool which is designed to make the creating, deploying and running of applications easier with the help of containers. Containers are something which allows the developer to bundle the application with all the necessary ingredients like different libraries, dependencies and ship is as only a single package.</p>
<p>We will go step by step</p>
<h2 id="1-creating-react-application">1. Creating React Application</h2>
<p>Create react app is a lot easier using the create-react-app (CRA)</p>
<p>We will use <strong><em>create-react-app </em></strong>package to install and configure simple react application from NPM, Open your terminal and install react app.</p>
<p>For more info on creating a react app
<a target="_blank" href="https://github.com/facebook/create-react-app"><strong>facebook/create-react-app</strong>
<em>Set up a modern web app by running one command. Contribute to facebook/create-react-app development by creating an…</em>github.com</a></p>
<blockquote>
<p>once you run the application using command
$ npm start
After that, it’s time to create a build the app, run
$ npm run build</p>
</blockquote>
<h2 id="2-creating-minimal-dockerfile">2. Creating minimal Dockerfile</h2>
<p>creating a docker file is a cup of your tea. The is no rocket science in creating a docker file.</p>
<p>Just Create a new file with name <strong><em>Dockerfile
</em></strong>Now once the file is created we will add some command to that which will help us to create, run, deploy the application.</p>
<p>Here the content of Dockerfile for react app. Note I’m using <strong><em>Nginx</em></strong> to as a server.</p>
<p>Once the docker file is created. I’m creating a new folder named <strong>deployment </strong>within the app directory which has a <strong><em>nginx.conf </em></strong>file</p>
<p>The content of nginx file, note that this is default configuration you may not need to alter this file unless you have some special requirements.</p>
<h2 id="3-installing-docker-on-your-machine">3. <strong>Installing Docker on your machine</strong></h2>
<p>Head to this link below and download it for your respective operating system
<a target="_blank" href="https://www.docker.com/products/docker-desktop"><strong>Docker Desktop</strong>
<em>Docker Desktop Enterprise is a new commercial desktop offering that gives you everything you need for enterprise-ready…</em>www.docker.com</a></p>
<p>Once it is installed run open your terminal and run below command to check it is installed successfully</p>
<blockquote>
<p>docker — — version</p>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520480368/RYgBGT4zh.png" alt="Docker version" /><em>Docker version</em></p>
<p>Now that we have the docker setup on our machine it’s time to create the first image using the following command</p>
<blockquote>
<p>docker build -t first-docker .</p>
</blockquote>
<p>more info about different command can be found <a target="_blank" href="https://docs.docker.com/engine/reference/commandline/build/">here</a>.</p>
<p>Once you run this command it will execute all the command listed down in the Dockerfile.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520482325/OpYDOSoOD.png" alt="Creating Image" /><em>Creating Image</em></p>
<p>we have successfully created the image. Let’s proceed to next step</p>
<h2 id="4-make-use-of-gcloud-sdk">4. Make use of gcloud SDK</h2>
<p>Download SDK from the below link and setup on your machine
<a target="_blank" href="https://cloud.google.com/sdk/"><strong>Cloud SDK | Cloud SDK | Google Cloud</strong>
<em>A collection of command line tools for the Google Cloud Platform. Includes gcloud, bq, gsutil and other important…</em>cloud.google.com</a></p>
<p>Now that we have the gcloud SDK setup on our machine</p>
<h3 id="create-a-new-project-in-gcp">- — Create a new project in GCP</h3>
<p>Next step is to create a new project in the GCP where we will be pushing our docker images to the containers.</p>
<p>Configure Docker to use <code>gcloud</code> as a credential helper or are using another <a target="_blank" href="https://cloud.google.com/container-registry/docs/advanced-authentication">authentication method</a>. To use <code>gcloud</code> as the credential helper, run the command:</p>
<ul>
<li><code>gcloud auth configure-docker</code></li>
</ul>
<p>It’s time to push the image to the registry</p>
<ol>
<li><p>Tag the local image with the registry name by using the command:</p>
</li>
<li><p><code>docker tag [SOURCE_IMAGE] [HOSTNAME]/[PROJECT-ID]/[IMAGE]</code></p>
</li>
<li><p>where <code>[SOURCE_IMAGE]</code> is the local image name.</p>
</li>
<li><p>This command names the image with the registry name and applies the tag <code>latest</code>. If you want to apply a different tag, then use the command:</p>
</li>
<li><p><code>docker tag [SOURCE_IMAGE] [HOSTNAME]/[PROJECT-ID]/[IMAGE]:[TAG]</code></p>
</li>
</ol>
<h2 id="push-the-tagged-image-to-container-registry">Push the tagged image to Container Registry</h2>
<p>Push the tagged image to Container Registry by using the command:</p>
<pre><code><span class="hljs-selector-tag">docker</span> <span class="hljs-selector-tag">push</span> <span class="hljs-selector-attr">[HOSTNAME]</span>/<span class="hljs-selector-attr">[PROJECT-ID]</span>/<span class="hljs-selector-attr">[IMAGE]</span>
</code></pre><p>This command pushes the image that has the tag <code>latest</code>. If you want to push an image that has a different tag, use the command:</p>
<pre><code><span class="hljs-selector-tag">docker</span> <span class="hljs-selector-tag">push</span> <span class="hljs-selector-attr">[HOSTNAME]</span>/<span class="hljs-selector-attr">[PROJECT-ID]</span>/<span class="hljs-selector-attr">[IMAGE]</span>:<span class="hljs-selector-attr">[TAG]</span>
</code></pre><p>When you push an image to a registry with a new hostname, Container Registry creates a storage bucket in the specified<a target="_blank" href="https://cloud.google.com/storage/docs/bucket-locations#location-mr">multi-regional location</a>. After pushing your image, you can:</p>
<ul>
<li><p>Go to the <a target="_blank" href="https://console.cloud.google.com/gcr">GCP Console</a> to view the registry and image.</p>
</li>
<li><p>Run <code>gcloud container images list-tags</code> to view the image's tag(s) and automatically-generated digest:</p>
</li>
<li><p><code>gcloud container images list-tags [HOSTNAME]/[PROJECT-ID]/[IMAGE]</code></p>
</li>
<li><p>The command’s output is similar to the following:</p>
</li>
<li><p><code>DIGEST TAGS TIMESTAMP
44bde... test 2017-..-..</code></p>
</li>
</ul>
<h3 id="where">Where</h3>
<ul>
<li><p><code>[HOSTNAME]</code> is listed under <strong>Location</strong> in the console. It's one of four options: <code>gcr.io</code>, <code>us.gcr.io</code>, <code>eu.gcr.io</code>, or <code>asia.gcr.io</code>.</p>
</li>
<li><p><code>[PROJECT-ID]</code> is your <a target="_blank" href="https://hackernoon.com/tagged/google">Google</a> Cloud Platform Console <a target="_blank" href="https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects">project ID</a>. See <a target="_blank" href="https://cloud.google.com/container-registry/docs/overview#domain-scoped_projects">Domain-scoped projects</a> for how to work with projects IDs that include a domain.</p>
</li>
<li><p><code>[IMAGE]</code> is the image's name in Container Registry.</p>
</li>
<li><p><code>[TAG]</code> is the tag applied to the image. In a registry, tags are unique to an image.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520484002/Cre4Cuuaa.png" alt="Pushing Image" /><em>Pushing Image</em></p>
<p>Navigate the GCP console and search of <strong><em>Container Registry, </em></strong>you will be able to see the image which we push.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520485780/u7WF-ZY07.png" alt /></p>
<p>It’s time to create cluster now inside <a target="_blank" href="https://cloud.google.com/kubernetes-engine/"><em>*</em>Kubernetes Engine</a><em>*</em> in GCP</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520487525/x7YNV8nGS.png" alt="Creating cluster" /><em>Creating cluster</em></p>
<p>Create deployment under workloads</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520489456/VEqWTJJuy.png" alt /></p>
<p>Select the image which you want to deploy and finally click on <strong><em>Expose</em> </strong>to expose the deployment.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520491209/vEedf0Xph.png" alt /></p>
<p>Set <strong><em>port to 80 in Target Port </em></strong>since we had EXPOSED our application to 80 in the Dockerfile</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520493053/ShEUULdvQ.png" alt /></p>
<p>Once you have exposed the port you will get IP Adress where your react application will be running live.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520495013/xp4shs03D.png" alt="Deployed Application" /><em>Deployed Application</em></p>
<p>And that it’s you are all set with docker. Whenever you want to push new image to the container first build the image with above-specified commands and then push the image to container registry and finally make that image live by going to rolling update option.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520496758/6lp83ge9z.png" alt /></p>
<p>Please note down your questions in the comment section below if you have any doubts &amp; I’ll be happy to address them.</p>
<p>That’s the end 🔚 I hope you have learned something new. 
Happy Learning! 💻 😃</p>
]]></content:encoded></item><item><title><![CDATA[An introduction to React Hooks]]></title><description><![CDATA[As the ReactJs library gets new updates, there are a lot of things being added and a few that are deprecated too. ReactJs is becoming more powerful day by…]]></description><link>https://harshmakadia.hashnode.dev/an-introduction-to-react-hooks-12843fcd2fd9</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/an-introduction-to-react-hooks-12843fcd2fd9</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Wed, 14 Nov 2018 21:50:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520511491/_GpFtMOeF.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>As the ReactJs library gets new updates, there are a lot of things being added and a few that are deprecated too. ReactJs is becoming more powerful day by day due to such updates. As a developer, you need to keep yourself up to date with new features coming out in every version.</p>
<h3 id="have-you-heard-about-react-hooks">Have you heard about React Hooks?</h3>
<p>Well, React Hooks, a feature which is available in <em>React v16.7.0-alpha,</em> is something awesome you should know about.</p>
<p>Here is a teaser for React Hooks.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520505418/Qe-XYQ9Yg.png" alt="React Hooks" /><em>React Hooks</em></p>
<p>In the above code, <code>useState</code> is the first Hook.</p>
<p>Now let’s jump into the problem that Reacts Hooks will be solving.</p>
<p>After all, every new feature is introduced to solve a problem. Here is the list of things that the <a target="_blank" href="https://reactjs.org/docs/hooks-intro.html">official react website</a> has to say about the problems that will be solved.</p>
<h3 id="its-hard-to-reuse-stateful-logic-between-components">It’s hard to reuse stateful logic between components</h3>
<p>Reusable behavior cannot be attached to the React component. A good example of it could be connecting to the store. If you’ve some experience in React, you may be knowing some of the patterns like <a target="_blank" href="https://reactjs.org/docs/render-props.html">render props</a> and <a target="_blank" href="https://reactjs.org/docs/higher-order-components.html">higher-order components</a> that can be handy while solving such problems. Using such patterns, components have to be restructured in order to use them making code harder to follow and maintain.</p>
<p>With the introduction of Hooks, stateful logic can be extracted from the component. This allows it to be tested independently, and it can be reused.</p>
<blockquote>
<p><strong><em>With Hooks, you can reuse stateful logic without actually changing your component hierarchy.</em></strong></p>
</blockquote>
<h3 id="complex-components-become-hard-to-understand">Complex components become hard to understand</h3>
<p>There are times when a component grows from having a small state to an unmanageable state of stateful logic.</p>
<p>Each lifecycle method sometimes contains a mix of unrelated logic. For example, a component might perform some data fetching via API calls in <code>componentDidMount</code> and <code>componentDidUpdate</code>. However, the same <code>componentDidMount</code> method might also contain some of the unrelated logic.</p>
<p>This logic sets up event listeners with cleanup performed in <code>componentWillUnmount</code>. Related code that changes together gets split.
The unrelated code which is combined into a single method brings in bugs and inconsistencies.</p>
<p>We often come across a situation where we are not able to split a large component into smaller ones because of the stateful values. Also, it becomes difficult to test them.</p>
<p>To solve this problem, <strong>Hooks let you split one component into smaller functions based on what pieces are related. A good example of it could be setting up a subscription or fetching data</strong>, irrespective of code split based on the lifecycle method.</p>
<blockquote>
<p><strong><em>With Hooks, more of React’s features can be used without the need for classes.</em></strong></p>
</blockquote>
<h2 id="but-how-do-hooks-really-work">But how do Hooks really work?</h2>
<p>Here is the code snippet we saw above:</p>
<p><a target="_blank" href="https://codesandbox.io/s/lpokw8ox67">Link to CodeSandbox</a></p>
<p>The use of <code>useState</code> is the Hook that we are talking about.</p>
<p>We call it inside a function component to add a local state to it. React will preserve this state between all the re-rendering happening. <code>useState</code> returns a pair which has the <em>current</em> state value and a function that lets you update the value.</p>
<p>You can call this function from an event handler or from somewhere else. It’s similar to <code>this.setState</code> in a React class, but it doesn’t merge the old and new state altogether.</p>
<p>There is only one argument to <code>useState</code> that is the initial state. In this example given above, the initial state is <code>0</code> because our counter starts from zero. Note that unlike <code>this.state</code>, the state here doesn’t have to necessarily be an object — however it can be an object if you want.</p>
<h3 id="declaring-multiple-state-variables">Declaring multiple state variables</h3>
<p>The <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Array_destructuring">array destructuring</a> syntax gives different names to the state variables which we declared by calling <code>useState</code>. These names don't belong to part of the <code>useState</code> API. Instead, React assumes that if you call a lot many times, you are doing it in the same order during the time of every render.</p>
<blockquote>
<p><strong>*Note: </strong>Hooks are functions that let you “hook into” React state and lifecycle features from function components. <strong>Hooks don’t work inside React classes </strong>— they let you use React without classes.*</p>
</blockquote>
<h2 id="effect-hook">Effect Hook</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520507829/y9Xqtzti7.png" alt /></p>
<p>Working with React you might have already worked on data fetching, subscriptions, or manually changing the DOM from React components. We call these operations as “side effects” (or “effects” in short).</p>
<p>The Effect Hook, <code>useEffect</code>, adds the ability to perform the side effects from a function component. It has the same purpose as <code>componentDidMount</code>, <code>componentDidUpdate</code>, and <code>componentWillUnmount</code> in React classes, but unified into a single API.</p>
<p>For example, the below component sets the document title after React updates the DOM:</p>
<p><a target="_blank" href="https://wn8q6741xl.codesandbox.io/">Link to CodeSandbox</a></p>
<p>When you make a call to <code>useEffect</code>, you’re telling React to run your “effect” function after flushing changes to the DOM. Effects are declared inside the component and thus have access to its props and state. By default, React runs the effects after every render that happens— <em>including</em> the first render.</p>
<h2 id="rules-of-hooks">Rules of Hooks</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520509574/Qy-IA8zLF.png" alt="Hooks Rules" /><em>Hooks Rules</em></p>
<p>Hooks are JavaScript functions, but they have two additional rules:</p>
<ul>
<li><p>Only call Hooks <strong>at the top level</strong>. Don’t try to call Hooks inside loops, conditions, or nested functions.</p>
</li>
<li><p>Only call Hooks <strong>from React function components</strong>. Don’t try to call Hooks from regular JavaScript functions.</p>
</li>
</ul>
<p>Well, this is a quick glance into React Hooks. For more detailed description follow this link below:
<a target="_blank" href="https://reactjs.org/docs/hooks-overview.html"><strong>Hooks at a Glance - React</strong>
<em>A JavaScript library for building user interfaces</em>reactjs.org</a></p>
<p>Happy Learning! 💻 😄</p>
]]></content:encoded></item><item><title><![CDATA[Meet Azure Logic Apps to know it’s amazing benefits]]></title><description><![CDATA[Wondering what are Azure Logic Apps? No worries I’ve got your back covered! Azure Logic Apps Azure Logic Apps is a cloud service that helps you automate…]]></description><link>https://harshmakadia.hashnode.dev/meet-azure-logic-apps-to-know-its-amazing-benefits-e2a622b06907</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/meet-azure-logic-apps-to-know-its-amazing-benefits-e2a622b06907</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Thu, 25 Oct 2018 08:32:21 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520197562/6yqCJQhGJ.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Wondering what are Azure Logic Apps? No worries I’ve got your back covered!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520192228/0BeZUQ0_Z.jpeg" alt="Azure Logic Apps" /><em>Azure Logic Apps</em></p>
<p>Azure Logic Apps is a cloud service that helps you automate and orchestrate tasks, business processes, and workflows when you need to integrate apps, systems, data, and services across enterprises or organizations. Logic Apps simplifies how you design and build scalable solutions for app integration, data/system integration, enterprise application integration, and business-to-business (B2B) communication, whether in the cloud, on-premises, or both.</p>
<p><strong><em>Here are some of the examples where you could use Azure logics apps</em></strong></p>
<ol>
<li><p>Send an email notification when something happens in your system, app or services</p>
</li>
<li><p>Move files to Azure storage from SFTP or FTP servers</p>
</li>
<li><p>Monitor the tweets on Twitter, perform sentiment analysis on them to create alert for the tweet which needs to be reviewed</p>
</li>
<li><p>Change the logic in your app just with some toggles of the switch, no deployment of your entire codebase needed</p>
<blockquote>
<p>These are some of the benefits too, you will have more idea about it as you continue reading about it below.</p>
</blockquote>
</li>
</ol>
<p>Have a look at a quick video below</p>
<p>Enterprise integration solutions can be built with Azure logic Apps with the help of readily available <strong><em>connectors</em></strong>. Connectors play an integral part when you create automated workflows with Azure Logic Apps. By using connectors in your logic apps, you expand the capabilities for your on-premises and cloud apps to perform tasks with the data that you create and already have.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520194135/ZsSwunU8T.jpeg" alt="Out of the box integration with Connectors" /><em>Out of the box integration with Connectors</em></p>
<h2 id="components-of-a-connector">Components of a Connector</h2>
<p>Each connector offers a set of operations classified as ‘Actions’ and ‘Triggers’. Once you connect to the underlying service, these operations can be easily leveraged within your apps and workflows.</p>
<h3 id="actions">Actions</h3>
<p>Actions are changes directed by a user. For example, you would use an action to look up, write, update, or delete data in a SQL database. All actions directly map to operations defined in the Swagger.</p>
<h3 id="triggers">Triggers</h3>
<p>Several connectors provide triggers that can notify your app when specific events occur. For example, the FTP connector has the OnUpdatedFile trigger. You can build either a Logic App or Flow that listens to this trigger and performs an action whenever the trigger fires</p>
<p>There are two types of trigger.</p>
<p><strong>Polling Triggers: </strong>These triggers call your service at a specified frequency to check for new data. When new data is available, it causes a new run of your workflow instance with the data as input.</p>
<p><strong>Push Triggers:</strong> These triggers listen for data on an endpoint, that is, they wait for an event to occur. The occurrence of this event causes a new run of your workflow instance.</p>
<p>Of course, it does come with a big box of benefits or rather why you should consider <a target="_blank" href="https://spr.com/9-fantastic-reasons-for-using-azure-logic-apps/">using Azure Logic Apps.</a></p>
<ol>
<li><p><strong>Create your own business process and flows visually
</strong>A lot of business-oriented processes and system integration are out of box provided by the logic apps. They are executed in logical order starting from the trigger. The connector comes into handy to make all your task easy like sending email notification etc. The time to go live is really quick.</p>
</li>
<li><p><strong>Wide Range of integration for the web, mobile apps, API apps and more</strong>
Azure logic apps come as a single integrated service which is compatible with websites, mobile apps, APIs and business processes. Rest APIs and JSON help to easily connect over HTTP.</p>
</li>
<li><p><strong>No scalability issues</strong>
As everything is taken care of by azure you can meet the increasing demands from the client and customers. Delivering apps at a massive scale is just a cup of your tea.</p>
</li>
<li><p><strong>No cost in setup</strong>
Since the entire things are managed by Microsoft Azure logic apps there is no setup cost involved. You only pay when the logic is executed. It’s that simple.</p>
</li>
<li><p><strong>Bonus — Increase in performance</strong>
Creating logic is pretty simple since built-in-modules is there to rescue. It indirectly leads to faster delivery of projects to end user.</p>
</li>
<li><p><strong>More insights through monitoring</strong>
With the help of Azure Logic Apps, organizations can gain insights into the status of their applications. Logic Apps provides strong diagnostics and auditing with the help of Azure OMS (Operations Management Suite). Monitoring and tracking of the creation of custom queries on the data can be easily done. custom PowerBI report generation is also supported here.</p>
</li>
<li><p><strong>Simplified Workflow definition</strong></p>
<blockquote>
<p>parameters, triggers, actions, outputs are the main parts of any logic apps.</p>
</blockquote>
</li>
</ol>
<p><strong>Parameters</strong> are things that you want to reuse across workflows. Re-using values or even complex objects throughout the definition makes it easier to comprehend. Separate out configuration from the definition itself makes sharing easy as well as across different environments.</p>
<p><strong>Triggers</strong> are what start the Logic App. Triggers can be evaluated at recurring intervals or have its state maintained across executions.</p>
<p><strong>Actions</strong> are the things that happen in a Logic App. Actions can depend on other actions. The dependencies are what will determine the order of the Actions executing. The state is also maintained across executions.</p>
<p><strong>Outputs</strong> are what gets sent from calls into the workflow.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520195946/7G12F2F72.png" alt="Sample workflow created using Azure Logic Apps" /><em>Sample workflow created using Azure Logic Apps</em></p>
<p>I hope the basics of azure logic are clear and you are now ready to roll with the actual implementation. 😄</p>
<p>For more detailed understanding about azure logic apps here is the link
<a target="_blank" href="https://docs.microsoft.com/en-us/azure/logic-apps/"><strong>Azure Logic Apps Documentation - Tutorials, API Reference</strong>
<em>Azure Logic Apps simplifies how you build automated scalable workflows that integrate apps and data across cloud…</em>docs.microsoft.com</a></p>
<p>Happy Learning! 💻</p>
]]></content:encoded></item><item><title><![CDATA[Why React16 is a blessing to React developers]]></title><description><![CDATA[Just like how people are excited about updating their mobile apps and OS, developers should also be excited to update their frameworks. The new version of…]]></description><link>https://harshmakadia.hashnode.dev/why-react16-is-a-blessing-to-react-developers-31433bfc210a</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/why-react16-is-a-blessing-to-react-developers-31433bfc210a</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Thu, 13 Sep 2018 15:11:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520527921/opVLj-FhM.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Just like how people are excited about updating their mobile apps and OS, developers should also be excited to update their frameworks. The new version of the different frameworks come with new features and tricks out of the box.</p>
<p>Below are some of the good features you should consider when migrating your existing app to React 16 from React 15.</p>
<blockquote>
<p><em>Time to say Goodbye React15 👋</em></p>
</blockquote>
<h2 id="error-handling">Error Handling</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520518713/qq91-ozQu.gif" alt="Error Handling be like :)" /><em>Error Handling be like :)</em></p>
<p>React 16 introduces the new concept of an <em>error boundary</em>.</p>
<p>Error boundaries are React components that <strong>catch JavaScript errors anywhere in their child component tree. They log those errors, and display a fallback UI</strong> instead of the crashed component tree. Error boundaries catch errors during rendering, in lifecycle methods, and in constructors of the whole tree below them.</p>
<p>A class component becomes an error boundary if it defines a new lifecycle method called <code>componentDidCatch(error, info)</code>:</p>
<p>Then you can use it as a regular component.</p>
<pre><code><span class="hljs-tag">&lt;<span class="hljs-name">ErrorBoundary</span>&gt;</span>  
   <span class="hljs-tag">&lt;<span class="hljs-name">MyWidget</span> /&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">ErrorBoundary</span>&gt;</span>
</code></pre><p>The <code>componentDidCatch()</code> method works like a JavaScript <code>catch {}</code> block, but for components. Only class components can be error boundaries. In practice, most of the time you’ll want to declare an error boundary component once. Then you’ll use it throughout your application.</p>
<p>Note that <strong>error boundaries only catch errors in the components below them in the tree</strong>. An error boundary can’t catch an error within itself. If an error boundary fails trying to render the error message, the error will propagate to the closest error boundary above it. This, too, is similar to how <code>catch {}</code> block works in JavaScript.</p>
<p>Check out the live demo:</p>
<p>For more information on error handling, head <a target="_blank" href="https://reactjs.org/blog/2017/07/26/error-handling-in-react-16.html">here</a>.</p>
<h2 id="new-render-return-types-fragments-and-strings">New render return types: fragments and strings</h2>
<p>Get rid of wrapping the component in a div while rendering.</p>
<p>You can now return an array of elements from a component’s <code>render</code> method. Like with other arrays, you’ll need to add a key to each element to avoid the key warning:</p>
<pre><code>render() {
  <span class="hljs-comment">// No need to wrap list items in an extra element!</span>
  <span class="hljs-keyword">return</span> [
    <span class="hljs-comment">// Don't forget the keys :)</span>
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">key</span>=<span class="hljs-string">"A"</span>&gt;</span>First item<span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span></span>,
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">key</span>=<span class="hljs-string">"B"</span>&gt;</span>Second item<span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span></span>,
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">key</span>=<span class="hljs-string">"C"</span>&gt;</span>Third item<span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span></span>,
  ];
}
</code></pre><p><a target="_blank" href="https://reactjs.org/blog/2017/11/28/react-v16.2.0-fragment-support.html">Starting with React 16.2.0</a>, it has support for a special fragment syntax to JSX that doesn’t require keys.</p>
<p>Support for returning strings :</p>
<pre><code>render() {
  <span class="hljs-keyword">return</span> <span class="hljs-string">'Look ma, no spans!'</span>;
}
</code></pre><h2 id="portals">Portals</h2>
<p>Portals provide a first-class way to render children into a DOM node that exists outside the DOM hierarchy of the parent component.</p>
<pre><code><span class="hljs-selector-tag">ReactDOM</span><span class="hljs-selector-class">.createPortal</span>(child, container)
</code></pre><p>The first argument (<code>child</code>) is any <a target="_blank" href="https://reactjs.org/docs/react-component.html#render">renderable React child</a>, such as an element, string, or fragment. The second argument (<code>container</code>) is a DOM element.</p>
<h3 id="how-to-use-it"><strong>How to use it</strong></h3>
<p>When you return an element from a component’s render method, it’s mounted into the DOM as a child of the nearest parent node:</p>
<pre><code>render() {
  <span class="hljs-comment">// React mounts a new div and renders the children into it</span>
  <span class="hljs-keyword">return</span> (
    &lt;div&gt;
      {<span class="hljs-keyword">this</span>.props.children}
    &lt;/div&gt;
  );
}
</code></pre><p>Sometimes it’s useful to insert a child into a different location in the DOM:</p>
<pre><code>render() {
  <span class="hljs-comment">// React does *not* create a new div. It renders the children into `domNode`.</span>
  <span class="hljs-comment">// `domNode` is any valid DOM node, regardless of its location in the DOM.</span>
  <span class="hljs-keyword">return</span> ReactDOM.createPortal(
    <span class="hljs-keyword">this</span>.props.children,
    domNode
  );
}
</code></pre><p>A typical use case for portals is when a parent component has an <code>overflow: hidden</code> or <code>z-index</code> style, but you need the child to visually “break out” of its container. For example, dialogs, hovercards, and tooltips.</p>
<h2 id="custom-dom-attribute">Custom DOM Attribute</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520521076/SnGbq7rrC.png" alt /></p>
<p>React15 used to ignore any unknown DOM attributes. It would just skip them since React didn’t recognize it.</p>
<pre><code><span class="hljs-comment">// Your code:</span>
&lt;div mycustomattribute=<span class="hljs-string">"something"</span> /&gt;
</code></pre><p>Would render an empty div to the DOM with React 15:</p>
<pre><code><span class="hljs-comment">// React 15 output:</span>
&lt;div /&gt;
</code></pre><p>In React16, the output will be the following (<em>custom attributes will be shown and not be ignored at all</em>):</p>
<pre><code><span class="hljs-comment">// React 16 output:</span>
&lt;div mycustomattribute=<span class="hljs-string">"something"</span> /&gt;
</code></pre><h2 id="avoid-re-render-with-setting-null-in-state">Avoid Re-render with setting NULL in state</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520523043/wrDFF6RNd.png" alt /></p>
<p>With React16 you can prevent state updates and re-renders right from <code>setState()</code>. You just need to have your function return <code>null</code>.</p>
<pre><code><span class="hljs-keyword">const</span> MAX_PIZZAS = <span class="hljs-number">20</span>;

function addAnotherPizza(state, props) {
  <span class="hljs-comment">// Stop updates and re-renders if I've had enough pizzas.</span>
  <span class="hljs-keyword">if</span> (state.pizza === MAX_PIZZAS) {
    <span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>;
  }

  <span class="hljs-comment">// If not, keep the pizzas coming! :D</span>
  <span class="hljs-keyword">return</span> {
    pizza: state.pizza + <span class="hljs-number">1</span>,
  }
}

<span class="hljs-keyword">this</span>.setState(addAnotherPizza);
</code></pre><p>Read more <a target="_blank" href="https://x-team.com/blog/react-render-setstate/">here</a>.</p>
<h2 id="creating-refs">Creating Refs</h2>
<p>Creating refs with React16 is now much easier. Why you need to use refs:</p>
<ul>
<li><p>Managing focus, text selection, or media playback.</p>
</li>
<li><p>Triggering imperative animations.</p>
</li>
<li><p>Integrating with third-party DOM libraries.</p>
</li>
</ul>
<p>Refs are created using <code>React.createRef()</code> and are attached to React elements via the <code>ref</code>attribute. Refs are commonly assigned to an instance property when a component is constructed so they can be referenced throughout the component.</p>
<pre><code><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyComponent</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">React</span>.<span class="hljs-title">Component</span> </span>{
  <span class="hljs-keyword">constructor</span>(props) {
    <span class="hljs-built_in">super</span>(props);
    <span class="hljs-built_in">this</span>.myRef = React.createRef();
  }
  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">ref</span>=<span class="hljs-string">{this.myRef}</span> /&gt;</span></span>;
  }
}
</code></pre><h3 id="accessing-refs"><strong>Accessing Refs</strong></h3>
<p>When a ref is passed to an element in <code>render</code>, a reference to the node becomes accessible at the <code>current</code> attribute of the ref.</p>
<pre><code><span class="hljs-keyword">const</span> node = <span class="hljs-keyword">this</span>.myRef.current;
</code></pre><p>The value of the ref differs depending on the type of the node:</p>
<ul>
<li><p>When the <code>ref</code> attribute is used on an HTML element, the <code>ref</code> created in the constructor with <code>React.createRef()</code> receives the underlying DOM element as its <code>current</code> property.</p>
</li>
<li><p>When the <code>ref</code> attribute is used on a custom class component, the <code>ref</code> object receives the mounted instance of the component as its <code>current</code>.</p>
</li>
<li><p><strong>You may not use the <code>ref</code> attribute on functional components</strong> because they don’t have instances.</p>
</li>
</ul>
<h2 id="context-api">Context API</h2>
<p>Context provides a way to pass data through the component tree without having to pass props down manually at every level.</p>
<h3 id="reactcreatecontext"><code>React.createContext</code></h3>
<pre><code><span class="hljs-keyword">const</span> {Provider, Consumer} = React.createContext(defaultValue);
</code></pre><p>Creates a <code>{ Provider, Consumer }</code> pair. When React renders a context <code>Consumer</code>, it will read the current context value from the closest matching <code>Provider</code> above it in the tree.</p>
<p>The <code>defaultValue</code> argument is <strong>only</strong> used by a Consumer when it does not have a matching Provider above it in the tree. This can be helpful for testing components in isolation without wrapping them. Note: passing <code>undefined</code> as a Provider value does not cause Consumers to use <code>defaultValue</code>.</p>
<h3 id="provider"><code>Provider</code></h3>
<pre><code>&lt;Provider <span class="hljs-keyword">value</span>={<span class="hljs-comment">/* some value */</span>}&gt;
</code></pre><p>A React component that allows Consumers to subscribe to context changes.</p>
<p>Accepts a <code>value</code> prop to be passed to Consumers that are descendants of this Provider. One Provider can be connected to many Consumers. Providers can be nested to override values deeper within the tree.</p>
<h3 id="consumer"><code>Consumer</code></h3>
<pre><code>&lt;Consumer&gt;
  {<span class="hljs-function"><span class="hljs-params">value</span> =&gt;</span> <span class="hljs-comment">/* render something based on the context value */</span>}
&lt;/Consumer&gt;
</code></pre><p>A React component that subscribes to context changes.</p>
<p>Requires a <a target="_blank" href="https://reactjs.org/docs/render-props.html#using-props-other-than-render">function as a child</a>. The function receives the current context value and returns a React node. The <code>value</code> argument passed to the function will be equal to the <code>value</code> prop of the closest Provider for this context above in the tree. If there is no Provider for this context above, the <code>value</code> argument will be equal to the <code>defaultValue</code> that was passed to <code>createContext()</code>.</p>
<h2 id="static-getderivedstatefromprops"><code>static getDerivedStateFromProps()</code></h2>
<p><code>getDerivedStateFromProps</code> is invoked right before calling the render method. Both on the initial mount and on subsequent updates. It should return an object to update the state, or null to update nothing.</p>
<p>This method exists for <a target="_blank" href="https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html#when-to-use-derived-state">rare use cases</a> where the state depends on changes in props over time. For example, it might be handy for implementing a <code>&amp;lt;Transition&amp;gt;</code> component that compares its previous and next children to decide which of them to animate in and out.</p>
<p>Deriving state leads to verbose code and makes your components difficult to think about.</p>
<p><a target="_blank" href="https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html">Make sure you’re familiar with simpler alternatives:</a></p>
<ul>
<li><p>If you need to <strong>perform a side effect</strong> (for example, data fetching or an animation) in response to a change in props, use <code>[componentDidUpdate</code>](https://reactjs.org/docs/react-component.html#componentdidupdate) lifecycle instead.</p>
</li>
<li><p>If you want to <strong>re-compute some data only when a prop changes</strong>, <a target="_blank" href="https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html#what-about-memoization">use a memoization helper instead</a>.</p>
</li>
<li><p>If you want to <strong>“reset” some state when a prop changes</strong>, consider either making a component <a target="_blank" href="https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html#recommendation-fully-controlled-component">fully controlled</a> or <a target="_blank" href="https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html#recommendation-fully-uncontrolled-component-with-a-key">fully uncontrolled with a <code>key</code></a> instead.</p>
</li>
</ul>
<p>This method doesn’t have access to the component instance. If you’d like, you can reuse some code between <code>getDerivedStateFromProps()</code> and the other class methods by extracting pure functions of the component props and state outside the class definition.</p>
<p>Note that this method is fired on <em>every</em> render, regardless of the cause. This is in contrast to <code>UNSAFE_componentWillReceiveProps</code>. It only fires when the parent causes a re-render and not as a result of a local <code>setState</code>.</p>
<p>We compare <code>nextProps.someValue</code> with <code>this.props.someValue.</code> If both are different then we perform some operation, <code>setState</code></p>
<pre><code>static getDerivedStateFromProps(nextProps, prevState){   <span class="hljs-keyword">if</span>(nextProps.someValue!==prevState.someValue){     
   <span class="hljs-keyword">return</span> { someState: nextProps.someValue};  
} <span class="hljs-keyword">else</span> <span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>;}
</code></pre><p>It receives two params <code>nextProps</code> and <code>prevState</code>. As mentioned previously, you cannot access <code>this</code> inside this method. You’ll have to store the props in the state to compare the <code>nextProps</code> with previous props. In above code <code>nextProps</code> and <code>prevState</code> are compared. If both are different then an object will be returned to update the state. Otherwise <code>null</code> will be returned indicating state update not required. If state changes then <code>componentDidUpdate</code> is called where we can perform the desired operations as we did in <code>componentWillReceiveProps</code>.</p>
<h2 id="bonus-react-lifecycle-events">Bonus: React Lifecycle events</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520526045/uF3hnSp_a.jpeg" alt /></p>
<p>Lifecycle credits — <a target="_blank" href="https://twitter.com/dceddia">https://twitter.com/dceddia</a></p>
<p>Well these are some of the features that you should definitely try while working with React16!</p>
<p>Happy coding 💻 😀</p>
]]></content:encoded></item><item><title><![CDATA[Machine Learning basics — It’s your cup of tea!]]></title><description><![CDATA[I’m sure every one of you must have heard of this buzzword Machine Learning. Wondering what it is. Let’s jump into its basics. Note: This is just an…]]></description><link>https://harshmakadia.hashnode.dev/machine-learning-basics-its-your-cup-of-tea-af4baf060ace</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/machine-learning-basics-its-your-cup-of-tea-af4baf060ace</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Sun, 09 Sep 2018 21:20:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520473078/1-mdJAnxZ.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I’m sure every one of you must have heard of this <em>buzzword</em> <a target="_blank" href="https://hackernoon.com/tagged/machine-learning">Machine Learning</a>. Wondering what it is. Let’s jump into its basics.</p>
<p><strong>Note</strong>: This is just an overview to have quick knowledge about machine learning and how it is helpful.</p>
<p><strong>Machine learning</strong> is an application of artificial intelligence (AI) that provides systems the ability to automatically learn and improve from experience without being explicitly programmed. <strong>Machine learning</strong> focuses on the <a target="_blank" href="https://hackernoon.com/tagged/development">development</a> of computer programs that can access data and use it learn for themselves.</p>
<h2 id="why-machine-learning-matters">Why Machine learning Matters?</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520442232/Zm7QmT2my.png" alt="Alpha Go" /><em>Alpha Go</em></p>
<p><strong>AlphaGo</strong> is a computer program that plays the board game Go. It was developed by Alphabet Inc.’s Google DeepMind in London.</p>
<p>AlphaGo defeated one of the best human players at Go — an extraordinary achievement in a game dominated by humans for two decades after machines first conquered chess.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520444185/wlIC4-r_I.jpeg" alt="Dota" /><em>Dota</em></p>
<p><strong>Dota</strong> 2 is a multiplayer online battle arena (MOBA) video game developed and published by Valve Corporation</p>
<p>OpenAI reached yet another incredible milestone by defeating the world’s top professionals in 1v1 matches of the online multiplayer game Dota 2</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520446509/_EHBsnl1q.png" alt /></p>
<p><strong>Google Translate</strong> is a machine <strong>translation</strong> website from <strong>Google</strong> that can <strong>translate</strong> text between different languages. It can <strong>translate</strong> words, sentences, documents and web pages between any combination of more than 100 supported languages. It was launched on April 28, 2006, and has always been free to use.</p>
<blockquote>
<p>Artificial intelligence will shape our future more powerfully than any other innovation this century.</p>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520448945/emb-qhXmG.png" alt="Machine Learning Types" /><em>Machine Learning Types</em></p>
<h2 id="supervised-learning">Supervised Learning</h2>
<p>Let’s look at the two task of supervised Learning</p>
<ol>
<li><p>Regression</p>
</li>
<li><p>Classification</p>
</li>
</ol>
<p><strong><em>SUPERVISED LEARNING = DATA SET CONTAINING TRAINING EXAMPLES WITH ASSOCIATED CORRECT LABELS</em></strong></p>
<p>Supervised Learning is a function that maps an input to an output based on example input-output pairs. It infers a function from labeled <strong>training</strong> data consisting of a set of <strong>training</strong> examples.</p>
<p>For example, learning to classify handwritten digits.</p>
<ul>
<li>Train your data set to such extent that it becomes easy to find out the result of unknown inputs.</li>
</ul>
<h2 id="how-supervised-learning-works">How supervised Learning Works?</h2>
<p>let’s examine the problem of predicting annual income of person based on the number of years of higher education he/she has completed.</p>
<p>Inshort,
Build a model that approximates the relationship <em>f </em>between the number of years of higher education X and corresponding annual incomeY</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520451157/sjkns02us.png" alt /></p>
<h3 id="solution">Solution</h3>
<p>There are two ways you can find a solution</p>
<p><strong>Engineering Solution
</strong>This solution would go by simple formula</p>
<pre><code><span class="hljs-attr">income</span> = (<span class="hljs-variable">$5</span>,<span class="hljs-number">000</span> * years_of_education) + baseline_income
</code></pre><p><strong>Learning Solution
</strong>Get information about some basic parameters like Degree Type, Years of work experience, School tiers etc. This will helps use to find the income easily.</p>
<p>For example: <em>“If they completed a Bachelor’s degree or higher, give the income estimate a 1.5x multiplier.”</em></p>
<h2 id="goal-of-supervised-learning">Goal of supervised Learning</h2>
<ul>
<li><p>Learns the relationship between income &amp; education from <em>scratch</em>, by running labeled training data through a learning algorithm.</p>
</li>
<li><p>This learned function can be used to estimate the income of people whose income Y is unknown, as long as we have years of education X as inputs.</p>
</li>
<li><p>Inshort, we can apply our model to the <strong>unlabelled </strong>test data to estimate</p>
<blockquote>
<p><strong>Predict Y as accurately as possible when given new examples where X is known and Y is unknown</strong>.</p>
</blockquote>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520454542/uEEJFf-i8.png" alt /></p>
<h2 id="regression-predicting-continuous-values"><strong>Regression — predicting continuous values</strong></h2>
<p>— Predicts a continuous target variable Y.
 — Estimate a value, such as housing prices or human lifespan, based on input data X.
 — Continuous means there aren’t gaps (discontinuities) in the value that Y can take on. Eg. A person’s weight and height are continuous values.
 — Discrete Variables means it can only take on a finite number of values Eg. Number of kids somebody has is a discrete variable.</p>
<blockquote>
<p>Predicting income is a classic regression problem. Your input data X includes all relevant information about individuals in the data set that can be used to predict income, such as years of education, years of work experience, job title, or zip code.</p>
</blockquote>
<p>— These attributes are called <strong>Features</strong>, which can be numerical(e.g. years of work experience) or categorical (e.g. job title or field of study).</p>
<p>You’ll want as many training observations as possible relating these features to the target output Y, so that your model can learn the relationship <em>f </em>between X and Y.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520456595/i6P67TnUn.png" alt /></p>
<h2 id="linear-regressionordinary-least-squares">Linear regression(ordinary least squares)</h2>
<p>We have our data set X<em>, </em>and corresponding target values Y. The goal of ordinary least squares (OLS) regression is to learn a linear model that we can use to predict a new <em>y </em>given a previously unseen <em>x </em>with as little error as possible. We want to guess how much income someone earns based on how many years of education they received.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520458521/szaCdsJ2-.png" alt /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520460501/mjXnvryXA.png" alt /></p>
<p><em>β0 </em>is the y-intercept and <em>β1 </em>is the slope of our line, i.e. how much income increases (or decreases) with one additional year of education.</p>
<p>Our goal is to learn the model parameters (in this case, <em>β0 </em>and <em>β1</em>) that minimize error in the model’s predictions.</p>
<p>To find the best parameters:</p>
<ol>
<li>*Define a cost function, or loss function, that measures how inaccurate our model’s predictions are.<ol>
<li>Find the parameters that minimize loss, i.e. make our model as accurate as possible.*</li>
</ol>
</li>
</ol>
<h2 id="classification">Classification</h2>
<ul>
<li><p>Classification predicts a discrete target label Y.</p>
</li>
<li><p>Classification is the problem of assigning new observations to the class to which they most likely belong, based on a classification model built from labeled training data.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520462474/FET14i6mZ.png" alt /></p>
<h3 id="logistic-regression-0-or-1">Logistic regression: 0 or 1?</h3>
<p>Deals with binary type of classification</p>
<p>— example, when assigning handwritten digits a label between 0 and 9, or using facial recognition to detect which friends are in a Facebook picture.</p>
<p><strong>SVM (Support vector Machines)</strong></p>
<p>— The algorithm is <strong>geometrically motivated </strong>in nature, rather than being driven by probabilistic thinking.
 — SVMs use a separating line (or, in more than two dimensions, a multi-dimensional hyperplane) to split the space into a red zone and a blue zone</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520464530/Y0Bt07SUY.png" alt /></p>
<p>— The distance to the nearest point on either side of the line is called the margin, and SVM tries to maximize the margin.
 — Think about it like a safety space: the bigger that space, the less likely that noisy points get misclassified.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520466389/cqK5fKefk.png" alt /></p>
<h2 id="unsupervised-learning">Unsupervised Learning</h2>
<p><strong>Unsupervised learning</strong> is a type of <strong>machine learning</strong> algorithm used to draw inferences from datasets consisting of input data without labeled responses. 
The most common <strong>unsupervised learning</strong> method is cluster analysis, which is used for exploratory data analysis to find hidden patterns or grouping in data.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520468503/YLIf1V0DU.png" alt /></p>
<h2 id="clustering">Clustering</h2>
<ul>
<li><p>Items inside a <strong>cluster </strong>should be very similar to each other, but very different from those outside.</p>
</li>
<li><p>Does grouping of data without being told ahead of time</p>
</li>
<li><p>Used for knowledge discovery rather than prediction</p>
</li>
</ul>
<p>— clustering is useful whenever there is diverse and varied data Famous clustering Method <strong>k-means</strong></p>
<p>Now you know about the basics types in Machine Learning let’s have quick look at the difference between supervised and unsupervised learning.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520470957/8-SSCNz6E.png" alt="Main Difference" /><em>Main Difference</em></p>
<p>That’s it you are all good with the basics of Machine Learning.</p>
<p>Happy Learning! 😆 🖥</p>
]]></content:encoded></item><item><title><![CDATA[Welcome to the Bots Era!]]></title><description><![CDATA[Wondering what’s bots era? Application of chatbots rages wide from being your sales rep, booking a restaurant or your favourite movie running in theatre to…]]></description><link>https://harshmakadia.hashnode.dev/welcome-to-the-bots-era-3a7eb7b01798</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/welcome-to-the-bots-era-3a7eb7b01798</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Sat, 18 Aug 2018 18:45:41 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520157436/nGNex8Np2.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Wondering what’s bots era?</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520144139/MlQ9ARuqs.jpeg" alt /></p>
<p>Application of chatbots rages wide from being your sales rep, booking a restaurant or your favourite movie running in theatre to answering customer queries. Chatbots can conduct conversations via auditory or textual methods. The good thing about them is they can function independently improving your business or get works done via integrations like facebook messenger, slack, skype and lot more.</p>
<p>Chatbots offer a customer a convenient way to get the information they need, help them in boosting the sales and due to there ease of use. Let’s look at some of the areas where chatbot has helped in growing the business in different sectors.</p>
<h2 id="e-commerce">E-commerce</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520145888/Trav5a4FG.png" alt /></p>
<blockquote>
<p>Chatbots are very useful in e-commerce helping brands to relate more quickly and directly with their customers on numerous messaging platforms.</p>
</blockquote>
<ul>
<li><p>Chatbots can become your advisor in buying the product online for better customer satisfaction.</p>
</li>
<li><p>Suggest products based on customer intents and browsing history.</p>
</li>
<li><p>Share information about the new products and offers via a simple message which can be sent out using any messaging platform to stay connected with the customers.</p>
</li>
</ul>
<h2 id="hospitality-and-travel">Hospitality and Travel</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520147533/UZzI4xPxG.jpeg" alt /></p>
<blockquote>
<p>Chatbots and service industries can go hand in hand to solve customer queries by saving time and providing a personalised experience to the customers.</p>
</blockquote>
<ul>
<li><p>Helps staff to focus on the critical and rewarding task by answering the frequently asked questions by the customers.</p>
</li>
<li><p>Chatbots can communicate in different languages and thus provide a personalized experience to the guests.</p>
</li>
<li><p>Ordering food has become easier like never before selecting options from a wide list of menu and filing in the delivery address can be done just by making minimal clicks on your smartphones.</p>
</li>
</ul>
<h2 id="call-centers">Call Centers</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520149263/h2AOadqQ4.png" alt /></p>
<blockquote>
<p><a target="_blank" href="https://www.businesswire.com/news/home/20140402005509/en/52-Percent-Consumers-Prefer-Text-Conversations-Support">Recent studies</a> show 52 Percent Of Consumers Prefer Text Conversations with Support Reps Over Their Current Support Method.</p>
</blockquote>
<ul>
<li><p>Chatbots can be made run 24 X 7 to have seamless interaction with the customer and also answer queries about multiple customers, unlike the human agent.</p>
</li>
<li><p>Gather information about the leads before it handovers to the human agent.</p>
</li>
<li><p>Customers get an instant response for their queries rather than waiting in queue to talk to the human agent. Human interaction might take hours or even days to resolve queries which can be done in the fraction of seconds with chatbots.</p>
</li>
</ul>
<h2 id="finance-assistant">Finance Assistant</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520150927/A-nwUEREH.jpeg" alt /></p>
<blockquote>
<p>Consumers will manage their 85% of the relationships with the enterprise without interacting with a human by 2020 according to this report by <a target="_blank" href="https://www.gartner.com/imagesrv/summits/docs/na/customer-360/C360_2011_brochure_FINAL.pdf">Gartner</a>.</p>
</blockquote>
<ul>
<li><p>Customers can manage multiple bank accounts and get there bank balance having the conversation with the finance bot anytime when needed.</p>
</li>
<li><p>Eliminate use to third-party apps to make payment and other transactions instead why not just chat with the bot?</p>
</li>
</ul>
<h2 id="healthcare">Healthcare</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520152604/c9ukJC3_3.png" alt /></p>
<blockquote>
<p>Grand View Research stipulates that the global chatbot market is estimated to touch at least <a target="_blank" href="https://www.grandviewresearch.com/info/about-us">$1.23 billion by 2025</a> which reflects a compounded annual growth rate (CAGR) of 24.3%.</p>
</blockquote>
<ul>
<li><p>Patients can get quick and effective medical advice remotely with the need of booking an appointment.</p>
</li>
<li><p>Medical chatbots can be programmed to handle the patient’s admission and discharge, order medical equipment for patients, renew prescriptions and schedule medical appointments.</p>
</li>
<li><p>The patients can ask questions anytime and get an immediate response from the <em>24 x 7</em> running chatbots.</p>
</li>
</ul>
<h2 id="wondering-where-can-you-get-such-chatbot-which-can-help-you-drastically-grow-your-business-and-boost-sales">Wondering where can you get such chatbot which can help you drastically grow your business and boost sales?</h2>
<h2 id="head-to-wotnotiohttpswotnotio">Head to <a target="_blank" href="https://wotnot.io/#/">WotNot.io</a></h2>
<p>WotNot is a bot making platform that easily integrates with your website and you can fully customize the bot as per your business needs.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520154707/I6nBAjufj.png" alt="Ready to use templates to get started" /><em>Ready to use templates to get started</em></p>
<p>Key Advantages of using WotNot.io</p>
<ol>
<li><p><strong>FAST ONBOARDING
</strong>Have the Chatbot available on your website just by entering your website URL and start reaping the benefits right away. No time is spent on training or teaching employees.</p>
</li>
<li><p><strong>READY TO USE TEMPLATES
</strong>It provides ready to use default templates to make your work easier and then you can customize it according to your need</p>
</li>
<li><p><strong>SALES BOOSTER
</strong>Capable of remembering customer preferences and uses order history to suggest products, learns from customer responses to the products advertised and cross-sells effectively.</p>
</li>
<li><p><strong>LEAD GENERATION
</strong>The chatbot can ask the necessary and related questions, persuade the user and generate a lead for you. The technology of the Chatbot ensures the flow is in the right direction to get higher conversion rates.</p>
</li>
<li><p><strong>MULTI LINGUAL
</strong>Chatbots can solve your customer care problems in multiple languages round the clock. This allows your business to scale up the operations to new markets while simultaneously personalising the experience for your customers.</p>
</li>
<li><p><strong>24/7 SUPPORT
</strong>Think of it as an unremitting virtual robot committed to delivering a proactive conversational experience from the get go. Round the clock.</p>
</li>
</ol>
<p>In conclusion there is no doubt that chatbots 🤖 are on the verge of conquering the world by proving an remarkable customer experience not matter which industry it is.</p>
]]></content:encoded></item><item><title><![CDATA[Get Started with RPA — Robotics Process Automation and it’s Tools]]></title><description><![CDATA[Robotic process automation (RPA) is the use of software with artificial intelligence (AI) and machine learning capabilities to handle high-volume…]]></description><link>https://harshmakadia.hashnode.dev/get-started-with-rpa-robotics-process-automation-and-its-tools-e5bfa03044ff</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/get-started-with-rpa-robotics-process-automation-and-its-tools-e5bfa03044ff</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Tue, 05 Jun 2018 15:15:47 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520209764/7fbQ_amRM.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Robotic process automation (RPA) is the use of software with artificial intelligence (AI) and machine learning capabilities to handle high-volume, repeatable tasks that previously required humans to perform. These tasks can include calculations, queries, and maintenance of transactions and records.</p>
<p>RPA evolved from three key technologies: screen scraping, workflow automation, and artificial intelligence.</p>
<p><img src="https://cdn-images-1.medium.com/max/2360/1*JkxnZQdQtZGtP_X9dsmBpg.png" alt="[Google Trends](https://cdn.hashnode.com/res/hashnode/image/upload/v1612520204641/5g3_8gCaH.html) (Robotics Process Automation)" /><em><a target="_blank" href="https://trends.google.com/trends/">Google Trends</a> (Robotics Process Automation)</em></p>
<h3 id="benefits-of-using-rpa">Benefits of using RPA —</h3>
<ul>
<li><p>Allowing processes to be completed much more rapidly saving human efforts</p>
</li>
<li><p>Creating cost savings for manual and repetitive tasks</p>
</li>
<li><p>Enabling employees to be more productive</p>
</li>
<li><p>Better customer service</p>
</li>
<li><p>Reduce manual data edits, increasing the quality of data and reducing compliance risks</p>
</li>
</ul>
<h3 id="applications-of-rpa">Applications of RPA —</h3>
<ol>
<li><p><strong>Data migration and entry -</strong>
There are many companies where critical functions are still performed by the legacy systems. Let’s say legacy billing systems need to perform some task that cannot be done using API’s, instead of employees manually migrating the data RPA can prove to prevent such manual labor and potential clerical errors.</p>
</li>
<li><p><strong>Extracting data from scanned documents, PDFs, and other formats -</strong>
Optical Character Recognition, Screen scraping technologies enables extraction of data from almost any format.</p>
</li>
<li><p><strong>Customer service -</strong>
By automating contact center tasks which also includes scanned documents, verifying information RPA can help companies to offer a good customer service.</p>
</li>
<li><p><strong>Human Resources -</strong>
RPA can also automate many HR tasks which include on-boarding and off-boarding of the employee, updating employee information and many more</p>
</li>
<li><p><strong>Healthcare -</strong>
RPA can handle patient records, customer support, claims, reporting, billing and lot more for providing the better experience to the patients</p>
</li>
<li><p><strong>Financial Services -</strong>
Foreign exchange payments, managing audit, processing claims, opening and closing of accounts are some of the use cases in this sector</p>
</li>
<li><p><strong>Supply Chain Management -</strong>
In this sector, RPA can help in automating orders, processing and payments, generating reports of different departments.</p>
</li>
</ol>
<h3 id="tools-that-can-be-used-for-rpa">Tools that can be used for RPA —</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520206154/feXPLP5d1.png" alt="Different Tools providing RPA solutions" /><em>Different Tools providing RPA solutions</em></p>
<blockquote>
<p><strong><em>So</em>me of the Links to different tools </strong>— 
Note that the names are based on the alphabetic order.</p>
</blockquote>
<p>AntWorks (<a target="_blank" href="http://www.ant.works">www.ant.works</a>)</p>
<p>Automation Anywhere (<a target="_blank" href="http://www.automationanywhere.com">www.automationanywhere.com</a>)</p>
<p>AutomationEdge (<a target="_blank" href="http://www.automationedge.com">www.automationedge.com</a>)</p>
<p>Blue Prism (<a target="_blank" href="http://www.blueprism.com">www.blueprism.com</a>)</p>
<p>Contextor (<a target="_blank" href="http://www.contextor.eu">www.contextor.eu</a>)</p>
<p>EdgeVerve Systems (<a target="_blank" href="http://www.edgeverve.com">www.edgeverve.com</a>)</p>
<p>EnableSoft (<a target="_blank" href="http://www.enablesoft.com">www.enablesoft.com</a>)</p>
<p>Epiance (<a target="_blank" href="http://www.epiplex500.com">www.epiplex500.com</a>)</p>
<p>Jacada (<a target="_blank" href="http://www.jacada.com">www.jacada.com</a>)</p>
<p>Jidoka (<a target="_blank" href="http://www.jidoka.io">www.jidoka.io</a>)</p>
<p>Kofax (<a target="_blank" href="http://www.kofax.com">www.kofax.com</a>)</p>
<p>Kryon Systems (<a target="_blank" href="http://www.kryonsystems.com">www.kryonsystems.com</a>)</p>
<p>Nice (<a target="_blank" href="http://www.nice.com">www.nice.com</a>)</p>
<p>OpenConnect (<a target="_blank" href="http://www.openconnect.com">www.openconnect.com</a>)</p>
<p>Pegasystems (<a target="_blank" href="http://www.pega.com">www.pega.com</a>)</p>
<p>Redwood Software (<a target="_blank" href="http://www.redwood.com/robotics">www.redwood.com/robotics</a>)</p>
<p>Softomotive (<a target="_blank" href="http://www.softomotive.com">www.softomotive.com</a>)</p>
<p>Syntel (<a target="_blank" href="http://www.syntelinc.com">www.syntelinc.com</a>)</p>
<p>Thoughtonomy (<a target="_blank" href="http://www.thoughtonomy.com">www.thoughtonomy.com</a>)</p>
<p>UiPath (<a target="_blank" href="http://www.uipath.com">www.uipath.com</a>)</p>
<p>Verint (<a target="_blank" href="http://www.verint.com">www.verint.com</a>)</p>
<p>WorkFusion (<a target="_blank" href="http://www.workfusion.com">www.workfusion.com</a>)</p>
<blockquote>
<p>In Summary, RPA cannot be ignored based on the number of advantages it provides and it’s application considered in many industries. RPA is the future of automating the repetitive tasks.</p>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520207803/hxILqXCwj.png" alt /></p>
]]></content:encoded></item><item><title><![CDATA[Alertly — An easier way to use JIRA with Slack]]></title><description><![CDATA[Make your work fun again! When it comes to people working together to build great software, the right tools can make all the difference. *Alertly* provides…]]></description><link>https://harshmakadia.hashnode.dev/alertly-an-easier-way-to-use-jira-with-slack-8272b6334e6f</link><guid isPermaLink="true">https://harshmakadia.hashnode.dev/alertly-an-easier-way-to-use-jira-with-slack-8272b6334e6f</guid><dc:creator><![CDATA[Harsh Makadia]]></dc:creator><pubDate>Wed, 18 Apr 2018 08:34:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520262358/fX_6QzqN9.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p>Make your work fun again!</p>
</blockquote>
<p>When it comes to people working together to build great software, the right tools can make all the difference. <a target="_blank" href="https://alertly.io/"><em>*</em>Alertly</a><em>*</em> provides you and your teammates with the ability to manage and work around JIRA alerts and complete tasks when due. Now, you can say goodbye to missing deadlines and dealing with tiny, annoying alerts as Alertly takes care of the whole task for you.</p>
<p>Here is a glimpse of the features which <a target="_blank" href="https://alertly.io/"><em>*</em>Alertly</a><em>*</em> provides 😀</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520247229/IDl-xEAp5.png" alt="Reminders on Slack" /><em>Reminders on Slack</em></p>
<h2 id="timely-jira-reminders"><strong>Timely JIRA Reminders</strong></h2>
<p>Be punctual. Be productive</p>
<p>Defining new filters will give you the freedom to create your own JIRA reminders. Alerts can also be created by providing additional details.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520249127/vFJwyAI1V.png" alt="Updates on Slack" /><em>Updates on Slack</em></p>
<h2 id="stay-updated">Stay Updated</h2>
<p>Send updates to every team member on slack so that your team members can move together towards achieving an objective.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520250943/6KfACixd_.png" alt="Customizing Slack Templates" /><em>Customizing Slack Templates</em></p>
<h2 id="custom-template">Custom Template</h2>
<p>Your days of using the same message template for very single message are over. With Alertly, <em>you have the power to define a message template.</em></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520252926/XfFnroaxR.png" alt="Update JIRA status from Slack" /><em>Update JIRA status from Slack</em></p>
<h2 id="actionable-alerts">Actionable Alerts</h2>
<p>An actionable alert helps you solve JIRA issues right from your Slack account. It is powerful as it is effective.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520254857/_8eXQwcNS.png" alt="Ready to use Templates" /><em>Ready to use Templates</em></p>
<h2 id="marketplace-synchronization">Marketplace Synchronization</h2>
<p>Skip the stress of creating events from scratch with Alertly’s marketplace feature which allows you to add events from your Marketplace to your dashboard.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520256760/tQWE4K_X6.png" alt="Easy Team Management" /><em>Easy Team Management</em></p>
<h2 id="easy-team-management">Easy Team Management</h2>
<p>Alertly makes team management incredibly easy. Every team leader gets updates from members regarding team progress and development.</p>
<p>Here are some previews from alertly</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520258674/rI2y8ZnzR.png" alt="Alertly + JIRA + Slack" /><em>Alertly + JIRA + Slack</em></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612520260692/4-vVyCRDK.png" alt="Slack Post" /><em>Slack Post</em></p>
<blockquote>
<p><strong>The Power to do More… Right at Your Own Convenience ✌️</strong></p>
</blockquote>
<p>Know more about the features 🚀 —<a target="_blank" href="https://alerty.io/#/features"> https://alertly.io/#features</a>
<a target="_blank" href="https://alertly.io/#features"><strong>Alertly - Your Personalized Slack Bot for JIRA Alerts</strong>
<em>Your days of using the same message template for very single message are over. With Alertly, you have the power to…</em>alertly.io</a></p>
]]></content:encoded></item></channel></rss>