DEV Community: Aman Kumar Jagdev The latest articles on DEV Community by Aman Kumar Jagdev (@amanjagdev). https://dev.to/amanjagdev https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F397275%2Fe0ad2b45-221b-4378-9729-95cfb1494027.png DEV Community: Aman Kumar Jagdev https://dev.to/amanjagdev en Best Chrome Extensions you should have as a web developer Aman Kumar Jagdev Fri, 07 May 2021 12:57:11 +0000 https://dev.to/amanjagdev/best-chrome-extensions-you-should-have-as-a-web-developer-53pf https://dev.to/amanjagdev/best-chrome-extensions-you-should-have-as-a-web-developer-53pf <h1> Getting Started </h1> <p>👋🏻 Hey <strong>Swift Readers</strong>, to keep it simple for you, you can skip the introduction and directly jump to extensions by clicking here</p> <h1> Introduction </h1> <p>I have been doing web for quite a time now, and like every other web developer, most of my time is spent on my browser(Chrome) and my code editor(VS Code).<br> As we all know most of us use Chrome 🌐 or some sort of Chromium-based daily, and extensions are something that can really improve the experience while using it. I always looked for interesting extensions to improve my productivity as a web developer and here are some which I found quite useful.</p> <p><a></a></p> <h1> Extensions </h1> <p>So, I have compiled a shortlist of Chrome extensions that I use regularly to increase productivity as a web developer. ✌🏻</p> <blockquote> <p>Click on the links below to jump to a particular extension<br> These extensions can be installed on any chromium-based browser.</p> <p>Major browser which supports these extensions is Chrome, Microsoft Edge (Chromium-based version), Brave and Chromium itself.</p> </blockquote> <ul> <li> <strong>WhatFont</strong> </li> <li> <strong>GitZip</strong> </li> <li> <strong>React Developer Tools</strong> </li> <li> <strong>JSON Formatter</strong> </li> <li> <strong>Cookie-Editor</strong> </li> <li> <strong>Color Picker – ColorZilla</strong> </li> </ul> <p><a></a></p> <h2> WhatFont </h2> <p><strong><em>Download</em></strong></p> <ul> <li> <a href="proxy.php?url=https://chrome.google.com/webstore/detail/whatfont/jabopobgcpjmedljpbcaablpmlmfcogm?hl=en" rel="noopener noreferrer">WhatFont | Chrome Web Store</a> </li> </ul> <p><strong><em>What it does?</em></strong></p> <p>This allows you to easily identify fonts present on a web page. It presents you with a beautiful one-click simple UI to inspect fonts, giving you all the required information about a font such as name, size, family, weight, etc.</p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl35kz18hznccw7n1yp8b.png" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl35kz18hznccw7n1yp8b.png" alt="WhatFont in Action"></a></p> WhatFont in Action <p><a></a></p> <h2> GitZip </h2> <p><strong><em>Download</em></strong></p> <ul> <li> <a href="proxy.php?url=https://chrome.google.com/webstore/detail/gitzip-for-github/ffabmkklhbepgcgfonabamgnfafbdlkn?hl=en" rel="noopener noreferrer">GitZip | Chrome Web Store</a> </li> </ul> <p><strong><em>What it does?</em></strong><br> This extension allows you to directly download files and sub-directories of a GitHub repository as zip, without having to clone or download the whole project.</p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fisvory428gx78qqmc6k9.png" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fisvory428gx78qqmc6k9.png" alt="GitZip in Action"></a></p> GitZip in Action <p><a></a></p> <h2> React Developer Tools </h2> <p><strong><em>Download</em></strong></p> <ul> <li> <a href="proxy.php?url=https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en" rel="noopener noreferrer">React Developer Tools | Chrome Web Store</a> </li> </ul> <p><strong><em>What it does?</em></strong></p> <p>This helps you to inspect your React components and their state inside the Chrome dev tools. It can be accessed in the new tabs in Chrome Dev Tools "⚛️Components" and "⚛️ Profiler“, which will be added after installation.</p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fenza5v3naw3g2hesk6lh.png" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fenza5v3naw3g2hesk6lh.png" alt="React Developer Tools in Action"></a></p> React Developer Tools in Action <p><a></a></p> <h2> JSON Formatter </h2> <p><strong><em>Download</em></strong></p> <ul> <li> <a href="proxy.php?url=https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa?hl=en" rel="noopener noreferrer">JSON Formatter | Chrome Web Store</a> </li> </ul> <p><strong><em>What it does?</em></strong></p> <p>It helps you to beautify &amp; format JSON with Syntax highlighting which makes it easier to read.<br> For example Responses in the form of JSON from an API.</p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F66626z40ygcux4gx0596.png" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F66626z40ygcux4gx0596.png" alt="JSON Formatter in Action"></a></p> JSON Formatter in Action <p><a></a></p> <h2> Cookie-Editor </h2> <p><strong><em>Download</em></strong></p> <ul> <li> <a href="proxy.php?url=https://chrome.google.com/webstore/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm?hl=en" rel="noopener noreferrer">Cookie-Editor | Chrome Web Store</a> </li> </ul> <p><strong><em>What it does?</em></strong></p> <p>This is a fast and easy-to-use cookie manager for your sites, you can easily delete, edit, search, add, protect and block cookies on your site. You can even import and export them in JSON format.</p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fycbl5z9xx8voev1vzy83.png" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fycbl5z9xx8voev1vzy83.png" alt="Cookie-Editor in Action"></a></p> Cookie-Editor in Action <p><a></a></p> <h2> ColorZilla </h2> <p><strong><em>Download</em></strong></p> <ul> <li> <a href="proxy.php?url=https://chrome.google.com/webstore/detail/colorzilla/bhlhnicpbhignbdhedgjhgdocnmhomnp/related" rel="noopener noreferrer">ColorZilla | Chrome Web Store</a> </li> </ul> <p><strong><em>What it does?</em></strong></p> <p>This extension helps you to extract a color reading from any point in your webpage. It provides you with an advanced eyedropper tool providing you with hex code of the color and other information.</p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk0phc8t9476fw131v306.png" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk0phc8t9476fw131v306.png" alt="ColorZilla - Colorpicker in Action"></a></p> ColorZilla - Colorpicker in Action <blockquote> <p>Moreover, you can also use the inbuilt color picker in power toys (if you are on windows).<br> To check out more interesting windows productivity tools, go to <a href="proxy.php?url=https://dev.to/amanjagdev/top-windows-apps-to-boost-your-productivity-3068">Top Windows apps to boost your productivity</a></p> </blockquote> <h1> What's next? </h1> <p>First and foremost, thank you for reading. If you've made it this far, <em>leave a reaction to show your support!</em></p> <p>Furthermore, feel free to <strong>leave a comment with any additional chrome extensions</strong> that you use on a regular basis, and let's have a healthy discussion over there. 😄</p> productivity webdev development extensions Top Windows apps to boost your productivity Aman Kumar Jagdev Sat, 24 Apr 2021 08:05:31 +0000 https://dev.to/amanjagdev/top-windows-apps-to-boost-your-productivity-3068 https://dev.to/amanjagdev/top-windows-apps-to-boost-your-productivity-3068 <h1> Getting Started </h1> <p>👋🏻 Hey <strong>Swift Readers</strong>, to keep it simple for you, you can skip the introduction and directly jump to apps by clicking here</p> <h1> Introduction </h1> <p>Since I remember using computers 💻 , I've been a windows 🐱‍💻 user (Except for a few Linux distro switches). I always wanted to improve my experience and I always looked for interesting applications to improve my productivity.<br> I've been developing for years and I'm still eager to find applications to improve my productivity both for general and development purposes.</p> <h1> More to come! </h1> <p>Many of the apps listed in this article are very feature-rich. I'm doing this as part of a series in which I'll be thoroughly discussing the best possible use cases and setups for each of these applications and their plugins to help you become a productivity god!!<br> So Stay tuned for updates on this series 😄</p> <p><a></a></p> <h1> Applications </h1> <p>So, I have compiled a shortlist of windows applications that I use regularly to increase my productivity. ✌🏻<br> The majority of the applications listed here are open source, and their repositories are also related if you want to contribute.</p> <blockquote> <p>Click on the links below to jump to a particular app<br> Moreover, Important links are present at the first line of each app for faster usage</p> </blockquote> <ul> <li> <strong>PowerToys</strong> </li> <li> <strong>Windows Terminal</strong> </li> <li> <strong>Auto Hot Key</strong> </li> <li> <strong>Everything</strong> </li> <li> <strong>Quick Look</strong> </li> </ul> <p><a></a></p> <h2> Power Toys </h2> <p><strong><em>Links</em></strong></p> <ul> <li> <a href="proxy.php?url=https://github.com/microsoft/PowerToys" rel="noopener noreferrer">Power Toys Github</a> </li> <li> <a href="proxy.php?url=https://github.com/microsoft/PowerToys/releases" rel="noopener noreferrer">Download | Releases Page</a> </li> </ul> <p><strong><em>What it does?</em></strong></p> <p>This is a utility application created by Microsoft. "Windows machine utilities to optimize efficiency," according to Microsoft's description.</p> <p><strong>In a Nutshell</strong>, This small application bundles many fantastic productivity features into a single package that would otherwise require the installation of several individual applications, such as an advanced color picker, Fancy Zones, Keyboard Manager, Power Rename, and much more!<br> <br></p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg5elbr5t7rkhvnarcj9f.png" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg5elbr5t7rkhvnarcj9f.png" alt="Power Toys HomeScreen"></a></p> Power Toys Application <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy2mungewj0nvg30kox9s.png" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy2mungewj0nvg30kox9s.png" alt="Power Toys Color Picker"></a></p> Color Picker <p>Above is just one example of what you can achieve with power toys, a full guide will be posted soon!</p> <p><a></a></p> <h2> Windows Terminal </h2> <p><strong><em>Links</em></strong></p> <ul> <li> <a href="proxy.php?url=https://aka.ms/terminal" rel="noopener noreferrer">Windows Terminal</a> </li> <li> <a href="proxy.php?url=https://aka.ms/terminal-preview" rel="noopener noreferrer">Windows Terminal Preview</a> </li> <li> <a href="proxy.php?url=https://github.com/microsoft/terminal" rel="noopener noreferrer">Windows Terminal Github</a> </li> </ul> <p><strong><em>What it does?</em></strong></p> <p>It is another Microsoft product that aims to combine all terminals into a single modern, fast, reliable, and effective terminal.</p> <p>It works for shells such as Command Prompt, PowerShell, and WSL.</p> <p>Some of its features are having multiple tabs, panes, and Unicode support, as well as UTF-8 support for all you emoji🤪 fans out there.</p> <p>But what sets it apart is that it has a GPU-accelerated rendering engine to speed it up and we can also build custom themes and designs for our command line.</p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff5wt1ar075hc10bycbng.png" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff5wt1ar075hc10bycbng.png" alt="Windows Terminal in Action"></a></p> Windows Terminal in Action <blockquote> <p>NOTE: The windows terminal will not look exactly like the image above when it is first installed. The full customization and configuration guide will be available soon!</p> </blockquote> <p><a></a></p> <h2> Auto hotkey </h2> <p><strong><em>Links</em></strong></p> <ul> <li> <a href="proxy.php?url=https://www.autohotkey.com/" rel="noopener noreferrer">Auto Hot Key</a> </li> <li> <a href="proxy.php?url=https://github.com/Lexikos/AutoHotkey_L" rel="noopener noreferrer">Auto Hot Key Github</a> </li> </ul> <p><strong><em>What it does?</em></strong></p> <p>It is simply a macro-creation and automation utility, that allows users to automate repetitive tasks.</p> <p>They have their own custom scripting language used to program .ahk (auto hotkey) script files.</p> <p>At its most potent, this is a very strong tool, and we can achieve incredible results with it. From extending a basic abbreviation to automating the whole system</p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9f464p3mlijht6flcro6.png" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9f464p3mlijht6flcro6.png" alt="Auto Hotkey in Action"></a></p> Auto Hot key in Action <p>Above is an example of a very simple script that can help you achieve simple automation, but you can look at this post to better understand the Auto Hotkey!</p> <p><a></a></p> <h2> Everything </h2> <p><strong><em>Links</em></strong></p> <ul> <li> <a href="proxy.php?url=https://www.voidtools.com/" rel="noopener noreferrer">Everyhting</a> </li> <li> <a href="proxy.php?url=https://www.voidtools.com/forum/" rel="noopener noreferrer">Everything Forums</a> </li> </ul> <p><strong><em>What it does?</em></strong></p> <p>One thing we may all agree on is that Windows search sucks, and while it has improved significantly, it is still far from perfect.</p> <p>"Everything," on the other hand, is a sophisticated search engine that immediately locates files and directories.</p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.voidtools.com%2Fsupport%2Feverything%2FEverything.Search.Window.png" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.voidtools.com%2Fsupport%2Feverything%2FEverything.Search.Window.png" alt="Everything in Action"></a></p> Everything in Action <p>The example above shows how you can search for something, but wait for the full guide for more amazing integrations of everything that can make your life even easier.</p> <p><a></a></p> <h2> Quick Look </h2> <p><strong><em>Links</em></strong></p> <ul> <li> <a href="proxy.php?url=https://www.microsoft.com/en-us/p/quicklook/9nv4bs3l1h4s" rel="noopener noreferrer">Quick Look</a> </li> </ul> <p><strong><em>What it does?</em></strong><br> According to their own description, "QuickLook enables a very quick preview of file contents by pressing the Spacebar"</p> <p>And it does just as it says, bringing up the fast preview functionality of Mac OS inside Windows.</p> <p>It supports a wide range of major image, video, text, and other file formats!<br> It will be a game-changer in terms of saving time when previewing files in windows.</p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstore-images.s-microsoft.com%2Fimage%2Fapps.17552.14405803611253731.f98cdd0b-804a-4451-892c-8f66e59e65a4.4ecde082-1946-4f39-89d2-400bf4c8e0ea%3Fw%3D672%26h%3D378%26q%3D80%26mode%3Dletterbox%26background%3D%2523FFE4E4E4%26format%3Djpg" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstore-images.s-microsoft.com%2Fimage%2Fapps.17552.14405803611253731.f98cdd0b-804a-4451-892c-8f66e59e65a4.4ecde082-1946-4f39-89d2-400bf4c8e0ea%3Fw%3D672%26h%3D378%26q%3D80%26mode%3Dletterbox%26background%3D%2523FFE4E4E4%26format%3Djpg" alt="Quickly previewing an Image file"></a></p> Quickly previewing an image file <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstore-images.s-microsoft.com%2Fimage%2Fapps.32960.14405803611253731.fc2b537f-239d-421a-964c-8f3a1b77a1af.e8a73cc7-4874-4db2-a60a-dfbbef550fcf%3Fw%3D672%26h%3D378%26q%3D80%26mode%3Dletterbox%26background%3D%2523FFE4E4E4%26format%3Djpg" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstore-images.s-microsoft.com%2Fimage%2Fapps.32960.14405803611253731.fc2b537f-239d-421a-964c-8f3a1b77a1af.e8a73cc7-4874-4db2-a60a-dfbbef550fcf%3Fw%3D672%26h%3D378%26q%3D80%26mode%3Dletterbox%26background%3D%2523FFE4E4E4%26format%3Djpg" alt="Quickly previewing a video file"></a></p> Quickly previewing an video file <h1> What's next? </h1> <p>First and foremost, thank you for reading. If you've made it this far, <em>leave a reaction to show your support!</em></p> <p>Check on series updates for complete guides on these individual applications and to further improve your experience with Windows.</p> <p>Furthermore, feel free to <strong>leave a comment with any additional productivity tools for Windows</strong> that you use on a regular basis, and let's have a healthy discussion over there. 😄</p> windows beginners tutorial productivity Build your React App Faster! Aman Kumar Jagdev Sat, 04 Jul 2020 05:08:49 +0000 https://dev.to/amanjagdev/build-your-react-app-faster-2bec https://dev.to/amanjagdev/build-your-react-app-faster-2bec <p>So I guess most of you must be wondering from the title that how can I build my apps faster. Is there some sort of extension for autocomplete or some niche little vscode tricks to get your development faster.<br> The answer is quite different.</p> <p>You all must have heard of templates and most of you might be using starter templates to make your apps. Some of you might be using good old <code>create-react-app</code>.</p> <p>So imagine you had a GUI app to just mention the name of your component and pages in react and if you want to have routing enabled and automatically you have an app to work with.. with all the things you needed in the first place.</p> <p>So I thought of making something that could achieve this.</p> <p>For those who are in a hurry can directly check it out themselves.<br> <a href="proxy.php?url=https://react-builder.now.sh" rel="noopener noreferrer">React Builder</a></p> <h1> Journey </h1> <p>One day as I was doing some project, I started with the create-react-app and started making different components and pages. As most of the apps nowadays require routing, I installed <code>react-router-dom</code> I set it up with the Navigation bar.<br> I used to repeat the above-mentioned process again and again in different projects. So I thought I should make a <strong>template</strong> out of it. But that would also be troublesome cause we have different component names and different routing styles and sometimes we don't even need routing.<br> I might need one component to be ClassBased with state and I might need one to be functional.<br> So from here, I got the idea of making React-Builder.</p> <h1> Solution </h1> <p>So the solution I thought is a GUI tool to help you get started with your react apps faster.</p> <p>So the Tool is named <a href="proxy.php?url=https://react-builder.now.sh" rel="noopener noreferrer">React Builder</a>.</p> <p>This is the homepage</p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fuh941df9pzc4ic7tcu4i.jpg" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fuh941df9pzc4ic7tcu4i.jpg" alt="Home Page"></a></p> <h1> Usage </h1> <h2> Step 1 | Choose your preferences </h2> <p>Here you can select your preferred starter environment currently it only supports <code>create-react-app</code>.<br> Moreover, you can choose between yarn or npm/npx. And you can give the name to your project.</p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fivz1ehlvqsmfj8je91ba.jpg" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fivz1ehlvqsmfj8je91ba.jpg" alt="Step1"></a></p> <h2> Step 2 | Choose Dependencies to add </h2> <p>You can directly mention packages you want to add in the app.<br> Ex: We have <code>react-router-dom axios</code> etc..</p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fojrts4l4u5ng5ujakery.jpg" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fojrts4l4u5ng5ujakery.jpg" alt="Step 2"></a></p> <h2> Step 3 | Add Components and Pages </h2> <p>Here you can add all the component Names with their type and you can select whether a component is a page or not.</p> <p>Note: <em>Routing will only be done between components marked as pages</em></p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F30j1762xf0gcnzzs7i8h.jpg" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F30j1762xf0gcnzzs7i8h.jpg" alt="Step 3"></a></p> <h2> Step 4 | Add routing </h2> <p>You can enable routing in your app from here. And you can select which component to use as Navigation Component or you can say Navigation Bar.</p> <p>NOTE : <em>Don't remove <code>react-router-dom</code> dependency if you enable routing</em></p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjzydf9q3m5ztk8ik526n.jpg" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjzydf9q3m5ztk8ik526n.jpg" alt="Step 4"></a></p> <h2> Step 5 | Build your App </h2> <p>Once you click on <strong>Create App</strong> It will download a js file and will give you a script</p> <p>You would need to place that js file in the folder you want to create the react app and run the script there.</p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1ked9rupzfmxsiknyymu.jpg" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1ked9rupzfmxsiknyymu.jpg" alt="Step 5"></a></p> <h2> Final Result </h2> <p>You have successfully created your react app with desired preferences. </p> <p>The folder structure generated with App.js on following the above steps looks like this.</p> <p><a href="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foolrnzcds8nlc0fdyiy0.jpg" class="article-body-image-wrapper"><img src="proxy.php?url=https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foolrnzcds8nlc0fdyiy0.jpg" alt="Result"></a></p> <p>As you can see it has generated all the components and pages and installed dependencies and also done routing in App.js and our Navigation Component.</p> <p>So what are you waiting for Start Hacking now<br> GO to : <a href="proxy.php?url=https://react-builder.now.sh" rel="noopener noreferrer">React Builder</a></p> <h3> Contribution </h3> <p>It is an open-source project. Take some time to look over the project yourself and feel free to make improvements and contribute to the noble cause</p> <p>REPO : <a href="proxy.php?url=https://github.com/amanjagdev/react-builder" rel="noopener noreferrer">https://github.com/amanjagdev/react-builder</a></p> react webdev reactrouter javascript Fed up with logging Everything! | AutoLogMe Aman Kumar Jagdev Sat, 27 Jun 2020 08:01:06 +0000 https://dev.to/amanjagdev/fed-up-with-logging-everything-autologit-2kmf https://dev.to/amanjagdev/fed-up-with-logging-everything-autologit-2kmf <p>Recently while I was working on my project and couldn't find the bug, Nothing seemed to be working. So I started with the oldest approach of just <em>logging everything I can</em>.</p> <p>Starting with things like "This function called" and then going on to the variables, step by step I started logging everything.</p> <p>Soon enough everything in the whole program was logged.😂<br><br> I realised that its too much work just to explicitly mention my function name and then logging variables. And as it became cluttered we had to use logs like "#####FUNCTION CALLED&gt;&gt;&gt;&gt;" and "foo&gt;&gt;&gt; ${foo}".</p> <h2> Journey </h2> <p>Suppose you only have a function that just does this automatically for you. You only need to pass in some variables and it will show you them in a formatted manner. Moreover you don't even to mention the name of the function and it will automatically log it for you.</p> <p>I thought of developing something that could just help me log everything faster and clearly than I do.</p> <h1> Solution | auto-log-me </h1> <p>I made an npm package to resolve the issue that you can use in your projects to easily do debugging and in general logging.</p> <p><em><em>auto-log-me</em></em><br> <a href="proxy.php?url=https://www.npmjs.com/package/auto-log-me">Check it out</a></p> <h3> What it does? </h3> <p>As the name suggests It helps you to debug your js programs by logging the function name with the variables and you can use one of the three given function to also log and Error, Warning or Info along with it.<br> The best part is everything is colour coded so it won't get cluttered.</p> <h4> Installation </h4> <p><code>yarn add auto-log-me</code><br> OR<br> <code>npm install auto-log-me</code></p> <h3> How to use it? </h3> <p>Import<br> </p> <div class="highlight js-code-highlight"> <pre class="highlight javascript"><code><span class="kd">const</span> <span class="p">{</span> <span class="nx">autoLog</span><span class="p">,</span> <span class="nx">autoLogE</span><span class="p">,</span> <span class="nx">autoLogI</span><span class="p">,</span> <span class="nx">autoLogW</span> <span class="p">}</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">auto-log</span><span class="dl">'</span><span class="p">);</span> </code></pre> </div> <p>OR<br> </p> <div class="highlight js-code-highlight"> <pre class="highlight javascript"><code><span class="k">import</span> <span class="p">{</span> <span class="nx">autoLog</span><span class="p">,</span> <span class="nx">autoLogE</span><span class="p">,</span> <span class="nx">autoLogI</span><span class="p">,</span> <span class="nx">autoLogW</span> <span class="p">}</span> <span class="k">from</span> <span class="dl">'</span><span class="s1">auto-log</span><span class="dl">'</span><span class="p">;</span> </code></pre> </div> <p>Usage | This Example shows many possibilities on how to use this.<br> </p> <div class="highlight js-code-highlight"> <pre class="highlight javascript"><code><span class="kd">const</span> <span class="nx">CalledInThis</span> <span class="o">=</span> <span class="p">()</span> <span class="o">=&gt;</span> <span class="p">{</span> <span class="kd">const</span> <span class="nx">foo</span> <span class="o">=</span> <span class="dl">"</span><span class="s2">Value of foo</span><span class="dl">"</span><span class="p">;</span> <span class="kd">const</span> <span class="nx">foosome</span> <span class="o">=</span> <span class="p">{</span> <span class="na">value</span><span class="p">:</span> <span class="dl">"</span><span class="s2">This is a object</span><span class="dl">"</span> <span class="p">};</span> <span class="nx">autoLogI</span><span class="p">(</span><span class="dl">'</span><span class="s1">Hi</span><span class="dl">'</span><span class="p">);</span> <span class="nx">autoLogW</span><span class="p">(</span><span class="dl">'</span><span class="s1">Hi</span><span class="dl">'</span><span class="p">);</span> <span class="nx">autoLog</span><span class="p">(</span><span class="dl">'</span><span class="s1">Hi</span><span class="dl">'</span><span class="p">);</span> <span class="nx">autoLogE</span><span class="p">(</span><span class="dl">'</span><span class="s1">Hi</span><span class="dl">'</span><span class="p">);</span> <span class="nx">autoLogI</span><span class="p">();</span> <span class="nx">autoLogW</span><span class="p">();</span> <span class="nx">autoLog</span><span class="p">();</span> <span class="nx">autoLogE</span><span class="p">();</span> <span class="nx">autoLogI</span><span class="p">(</span><span class="dl">''</span><span class="p">,</span> <span class="p">{</span> <span class="nx">foo</span><span class="p">,</span> <span class="nx">foosome</span> <span class="p">});</span> <span class="nx">autoLogW</span><span class="p">(</span><span class="dl">''</span><span class="p">,</span> <span class="p">{</span> <span class="nx">foo</span><span class="p">,</span> <span class="nx">foosome</span> <span class="p">});</span> <span class="nx">autoLogE</span><span class="p">(</span><span class="dl">'</span><span class="s1">You can even write errors</span><span class="dl">'</span><span class="p">,</span> <span class="p">{</span> <span class="nx">foo</span><span class="p">,</span> <span class="nx">foosome</span> <span class="p">});</span> <span class="nx">autoLog</span><span class="p">(</span><span class="dl">''</span><span class="p">,</span> <span class="p">{</span> <span class="nx">foo</span><span class="p">,</span> <span class="nx">foosome</span> <span class="p">});</span> <span class="p">}</span> <span class="nx">CalledInThis</span><span class="p">();</span> </code></pre> </div> <p><em>Output</em><br> <a href="proxy.php?url=https://res.cloudinary.com/practicaldev/image/fetch/s--s8CaF-W_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4xm7tldybufp76l8x48r.jpg" class="article-body-image-wrapper"><img src="proxy.php?url=https://res.cloudinary.com/practicaldev/image/fetch/s--s8CaF-W_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4xm7tldybufp76l8x48r.jpg" alt="Output of the above code"></a></p> webdev node react javascript Getting Started with React Hooks Aman Kumar Jagdev Thu, 25 Jun 2020 12:23:23 +0000 https://dev.to/amanjagdev/getting-started-with-react-hooks-h5h https://dev.to/amanjagdev/getting-started-with-react-hooks-h5h <p>In February 2019, React Team finally announced the stable release of React (Version — 16.8.0)with React Hooks included.<br> In this tutorial, we will go through the basics of React Hooks. We will go through topics such as what are React Hooks and how can you start using them today.</p> <p>And at the last, we will focus on how you can easily rewrite your old Components into new ones using Hooks.</p> <h1> What Are React Hooks? </h1> <p>React Hooks let you use state, and other React features without having to define a Class-Based component. It basically helps you to make your code cleaner and easier to manage. React hooks lets you simply all the react lifecycle methods and use the state and other features in a Functional Component.</p> <p>According to React’s official docs</p> <blockquote> <p>A Hook is a special function that lets you “hook into” React features.</p> </blockquote> <p>Before hooks only React Hooks, Only Stateful Components(i.e Class-Based components ) were able to use state and we could change the state using <code>this.setState()</code> method.</p> <p>We used different lifecycle methods like <code>componentDidMount()</code> , <code>componetWillMount()</code> , <code>componentDidUpdate()</code></p> <p>And a basic counter program will look something like this:<br> </p> <div class="ltag_gist-liquid-tag"> </div> <p>Now In the above code, we have created a basic counter variable in the state and we are updating it using <code>setState()</code> method.</p> <p><a href="proxy.php?url=https://res.cloudinary.com/practicaldev/image/fetch/s--si2REKRV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/qtuzvahce7bzunjv3t2x.png" class="article-body-image-wrapper"><img src="proxy.php?url=https://res.cloudinary.com/practicaldev/image/fetch/s--si2REKRV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/qtuzvahce7bzunjv3t2x.png" alt="Code Preview"></a></p> <blockquote> <p>Now there are many hooks available to use in functional component to mimic the same functionality.</p> </blockquote> <p>Such as <code>useState(), useEffect() , useReducer(), useContext()</code> and there are some other uncommon ones too.<br> But today we will be focusing on the <code>useState()</code> hook.</p> <h1> useState() </h1> <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.<br> <code>useState()</code> returns a pair which has the current state value and a function that lets you update the value.</p> <p>Here to mimic the same code we start by a simple functional component and add the hook to it.<br> </p> <div class="highlight js-code-highlight"> <pre class="highlight javascript"><code><span class="kd">const</span> <span class="p">[</span><span class="nx">count</span><span class="p">,</span> <span class="nx">setCount</span><span class="p">]</span> <span class="o">=</span> <span class="nx">useState</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span> </code></pre> </div> <p>Then we have a local state count = 0 and a function setCount() we can update the value of count by passing the new value in <code>setCount(value)</code>.</p> <p>And React will automatically handle the re-rendering of the component once the state is updated.</p> <p>We need to import the hook from ‘react’ in order to use it.<br> </p> <div class="highlight js-code-highlight"> <pre class="highlight javascript"><code><span class="k">import</span> <span class="nx">React</span><span class="p">,</span> <span class="p">{</span> <span class="nx">useState</span> <span class="p">}</span> <span class="k">from</span> <span class="dl">"</span><span class="s2">react</span><span class="dl">"</span><span class="p">;</span> </code></pre> </div> <p>And now we add a function to handle the updation every time the button gets clicked.<br> </p> <div class="highlight js-code-highlight"> <pre class="highlight javascript"><code><span class="kd">const</span> <span class="nx">updateCounter</span> <span class="o">=</span> <span class="p">()</span> <span class="o">=&gt;</span> <span class="p">{</span> <span class="nx">setCount</span><span class="p">(</span><span class="nx">count</span> <span class="o">+</span> <span class="mi">1</span><span class="p">);</span> <span class="p">};</span> </code></pre> </div> <p>And the final code using hooks will look something like this:</p> <div class="ltag_gist-liquid-tag"> </div> <p>The above code will yield the same result as the previous one and hence we have successfully made a component with hooks.</p> <p>There are many more hooks that we have not discussed here as it was just an introduction to the topic. I will soon update another hook’s story too. Meanwhile, you can visit the official website of ReactJS to study other hooks.</p> <p>Now another question arises that …</p> <h3> Should you rewrite every single old component using hooks? </h3> <p>The answer to it is probably not, Class-based components and other lifecycle methods are not going anywhere soon. You should learn hooks and try to write new components using hooks.<br> If you have made big projects, It won't be a very good idea to rewrite them using hooks and you can definitely add new components using hooks which will be totally fine as you can mix Class and Function components.</p> <h3> To Study More </h3> <p>For more details on this, refer to React’s official website:</p> <p><a href="proxy.php?url=https://reactjs.org/docs/hooks-intro.html">Official React Docs</a></p> hooks react webdev javascript React State Management with Recoil Aman Kumar Jagdev Wed, 24 Jun 2020 16:52:15 +0000 https://dev.to/amanjagdev/react-state-management-with-recoil-5hbb https://dev.to/amanjagdev/react-state-management-with-recoil-5hbb <p>Recently in May 2020, A open Source project by the Facebook experimental community, Recoil's development was started. Now the project is set-up and is mostly ready to use.</p> <p>NOTE: Beware, the project is still in development So I wouldn't suggest to use it directly in production projects.</p> <h1> What is recoil? </h1> <p>Recoil is a state management library developed by Facebook Experimental. But don't think of it as just another library.</p> <p>As we all know recently Reacts Hooks came into play, and I love using React hooks. they make everything so much simple and the best part is not going over the fuss of classes and this.</p> <p>If you also love using Hooks then Recoil is perfect for you.</p> <h2> What's Different? </h2> <p>If you are familiar with the other state management libraries then you must be familiar with the fact that all the state management libraries till now are only focused on the <code>state</code>. Every one of them like redux and context API is basically about handling the state the old way. Although they have implemented the hooks in them it still doesn't feel like using the native react hooks.<br> So, now let's see what recoil does differently :</p> <ul> <li>It feels just like React (just like a global version of <code>useState</code>)</li> <li>Easy State Management </li> <li>Simple concepts like <code>atom</code> and <code>selectors</code> </li> </ul> <h2> Get Started | Implementing State </h2> <p>So basically there are two concepts introduced in Recoil i.e atom and selectors.</p> <p>but before that, you need to add to your Application<br> </p> <div class="highlight js-code-highlight"> <pre class="highlight javascript"><code><span class="k">import</span> <span class="nx">React</span> <span class="k">from</span> <span class="dl">'</span><span class="s1">react</span><span class="dl">'</span><span class="p">;</span> <span class="k">import</span> <span class="p">{</span> <span class="nx">RecoilRoot</span> <span class="p">}</span> <span class="k">from</span> <span class="dl">'</span><span class="s1">recoil</span><span class="dl">'</span><span class="p">;</span> <span class="kd">const</span> <span class="nx">App</span> <span class="o">=</span> <span class="p">()</span> <span class="o">=&gt;</span> <span class="p">{</span> <span class="k">return</span> <span class="p">(</span> <span class="o">&lt;</span><span class="nx">RecoilRoot</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="nx">TextInput</span><span class="o">/&gt;</span> <span class="o">&lt;</span><span class="nx">CharacterCount</span><span class="o">/&gt;</span> <span class="c1">//Other Components</span> <span class="o">&lt;</span><span class="sr">/RecoilRoot</span><span class="err">&gt; </span> <span class="p">);</span> <span class="p">}</span> </code></pre> </div> <h3> Atom </h3> <p>An atom represents a piece of state. Atoms can be understood as something that can be read from and written to from any component.<br> Components which are associated with this atom will automatically be re-rendered once atom is updated.<br> </p> <div class="highlight js-code-highlight"> <pre class="highlight javascript"><code><span class="kd">const</span> <span class="nx">someState</span> <span class="o">=</span> <span class="nx">atom</span><span class="p">({</span> <span class="na">key</span><span class="p">:</span> <span class="dl">'</span><span class="s1">textState</span><span class="dl">'</span><span class="p">,</span> <span class="c1">// have to be unique for recoil internal reasons</span> <span class="na">default</span><span class="p">:</span> <span class="dl">''</span><span class="p">,</span> <span class="c1">// initial value of state/atom</span> <span class="p">});</span> </code></pre> </div> <h3> Selectors </h3> <p>A selector represents a piece of derived state. You can think of this as the output of passing state to a function that modifies the given state in some way.<br> </p> <div class="highlight js-code-highlight"> <pre class="highlight javascript"><code><span class="c1">//Gives the No of charecters</span> <span class="kd">const</span> <span class="nx">charCountState</span> <span class="o">=</span> <span class="nx">selector</span><span class="p">({</span> <span class="na">key</span><span class="p">:</span> <span class="dl">'</span><span class="s1">charCountState</span><span class="dl">'</span><span class="p">,</span> <span class="c1">// Have to Be Unique</span> <span class="na">get</span><span class="p">:</span> <span class="p">({</span><span class="kd">get</span><span class="p">})</span> <span class="o">=&gt;</span> <span class="p">{</span> <span class="kd">const</span> <span class="nx">text</span> <span class="o">=</span> <span class="kd">get</span><span class="p">(</span><span class="nx">someState</span><span class="p">);</span> <span class="c1">//pass a atom in this function</span> <span class="k">return</span> <span class="nx">text</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="p">},</span> <span class="p">});</span> </code></pre> </div> <h2> Getting Started | Using State </h2> <p>There are two ways to get the declared state into our components. i.e By <code>useRecoilState</code> or <code>useRecoilValue</code>.</p> <h3> useRecoilValue </h3> <p>Whenever you want to use the value of the state but don't want to update it in the whole component.<br> </p> <div class="highlight js-code-highlight"> <pre class="highlight javascript"><code><span class="k">import</span> <span class="p">{</span> <span class="nx">useRecoilValue</span> <span class="p">}</span> <span class="k">from</span> <span class="dl">'</span><span class="s1">recoil</span><span class="dl">'</span><span class="p">;</span> <span class="kd">const</span> <span class="nx">CharacterCount</span> <span class="o">=</span> <span class="p">()</span> <span class="o">=&gt;</span> <span class="p">{</span> <span class="kd">const</span> <span class="nx">count</span> <span class="o">=</span> <span class="nx">useRecoilValue</span><span class="p">(</span><span class="nx">charCountState</span><span class="p">);</span> <span class="c1">//Name of the Atom or selector</span> <span class="k">return</span> <span class="o">&lt;&gt;</span><span class="nx">Character</span> <span class="na">Count</span><span class="p">:</span> <span class="p">{</span><span class="nx">count</span><span class="p">}</span><span class="o">&lt;</span><span class="sr">/&gt;</span><span class="err">; </span><span class="p">}</span> </code></pre> </div> <h3> useRecoilState </h3> <p>Whenever you want to use the value of the state and also want to update globally through the component itself.<br> </p> <div class="highlight js-code-highlight"> <pre class="highlight javascript"><code><span class="k">import</span> <span class="p">{</span> <span class="nx">useRecoilState</span> <span class="p">}</span> <span class="k">from</span> <span class="dl">'</span><span class="s1">recoil</span><span class="dl">'</span><span class="p">;</span> <span class="kd">const</span> <span class="nx">TextInput</span> <span class="o">=</span> <span class="p">()</span> <span class="o">=&gt;</span> <span class="p">{</span> <span class="kd">const</span> <span class="p">[</span><span class="nx">text</span><span class="p">,</span> <span class="nx">setText</span><span class="p">]</span> <span class="o">=</span> <span class="nx">useRecoilState</span><span class="p">(</span><span class="nx">someState</span><span class="p">);</span> <span class="kd">const</span> <span class="nx">onChange</span> <span class="o">=</span> <span class="p">(</span><span class="nx">event</span><span class="p">)</span> <span class="o">=&gt;</span> <span class="p">{</span> <span class="nx">setText</span><span class="p">(</span><span class="nx">event</span><span class="p">.</span><span class="nx">target</span><span class="p">.</span><span class="nx">value</span><span class="p">);</span> <span class="p">};</span> <span class="k">return</span> <span class="p">(</span> <span class="o">&lt;</span><span class="nx">div</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="nx">input</span> <span class="nx">type</span><span class="o">=</span><span class="dl">"</span><span class="s2">text</span><span class="dl">"</span> <span class="nx">value</span><span class="o">=</span><span class="p">{</span><span class="nx">text</span><span class="p">}</span> <span class="nx">onChange</span><span class="o">=</span><span class="p">{</span><span class="nx">onChange</span><span class="p">}</span> <span class="sr">/</span><span class="err">&gt; </span> <span class="o">&lt;</span><span class="nx">br</span> <span class="o">/&gt;</span> <span class="nx">Value</span> <span class="k">of</span> <span class="nx">the</span> <span class="na">state</span> <span class="p">:</span> <span class="p">{</span><span class="nx">text</span><span class="p">}</span> <span class="o">&lt;</span><span class="sr">/div</span><span class="err">&gt; </span> <span class="p">);</span> <span class="p">}</span> </code></pre> </div> <h2> Conclusion </h2> <p>We have successfully implemented the global state using Recoil. Although this was a small part but it is enough to use it in your projects. As we all know its a developing project so many changes whether they be explicit in syntax or under the hood. So I wouldn't really suggest to use it in big projects one can always try new things and in my opinion if you like Hooks then you would love using Recoil.</p> <h3> Refrences </h3> <ul> <li><a href="proxy.php?url=https://recoiljs.org/docs/introduction/getting-started">Getting Stated with Recoil</a></li> <li><a href="proxy.php?url=https://recoiljs.org">Official Docs</a></li> </ul> react recoil webdev javascript