<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Saugat Rai</title>
    <description>The latest articles on DEV Community by Saugat Rai (@raisaugat).</description>
    <link>https://dev.to/raisaugat</link>
    <image>
      <url>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%2F151345%2F19a37891-839f-44a8-9a08-d64960f5d5bf.png</url>
      <title>DEV Community: Saugat Rai</title>
      <link>https://dev.to/raisaugat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/raisaugat"/>
    <language>en</language>
    <item>
      <title>How do you compensate the space that fixed header takes place in react?</title>
      <dc:creator>Saugat Rai</dc:creator>
      <pubDate>Fri, 18 Dec 2020 10:04:18 +0000</pubDate>
      <link>https://dev.to/raisaugat/how-do-you-compensate-the-space-that-fixed-header-takes-place-in-react-5b79</link>
      <guid>https://dev.to/raisaugat/how-do-you-compensate-the-space-that-fixed-header-takes-place-in-react-5b79</guid>
      <description>&lt;p&gt;Let's say there is fixed header component that has two or more component. The component has it's own rendering function. Some may render earlier while some may render later.&lt;/p&gt;

&lt;p&gt;If header has two component&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yzlfXMHx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/89bml0u01o7rxnulm6a7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yzlfXMHx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/89bml0u01o7rxnulm6a7.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If header has only one component&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zCTxXOfh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/w2wz1l5kpwffbgtoix9q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zCTxXOfh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/w2wz1l5kpwffbgtoix9q.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Below the header component, there is section that renders list of information. Since the header is fixed, the list component has to be given certain top value in order for it to be placed just below fixed header component.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;How can one manage the top value for list regarding that the fixed container can have 1 or more component render?&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;The solution I have come up is this.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zc4hzk8D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/w4x35jwjpmmaktv836z1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zc4hzk8D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/w4x35jwjpmmaktv836z1.png" alt="Image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will grab the total height the fixed container takes and store it in css variable which will then be access by list component. &lt;br&gt;
But the problem here is that it is one time only. If certain component render few seconds later, it won't add that component height.&lt;/p&gt;

&lt;p&gt;Any suggestions on how can this be changed or updated?&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>ask</category>
      <category>discuss</category>
    </item>
    <item>
      <title>What are basic practices for implementing css/scss modules in react project?</title>
      <dc:creator>Saugat Rai</dc:creator>
      <pubDate>Mon, 30 Nov 2020 11:30:43 +0000</pubDate>
      <link>https://dev.to/raisaugat/what-are-basic-practices-for-implementing-css-scss-modules-in-react-project-3dga</link>
      <guid>https://dev.to/raisaugat/what-are-basic-practices-for-implementing-css-scss-modules-in-react-project-3dga</guid>
      <description>&lt;p&gt;Tutorials would be great too. :) &lt;/p&gt;

</description>
      <category>react</category>
      <category>css</category>
      <category>discuss</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to show progress percentage in gradient bar?</title>
      <dc:creator>Saugat Rai</dc:creator>
      <pubDate>Mon, 16 Mar 2020 19:00:06 +0000</pubDate>
      <link>https://dev.to/raisaugat/how-to-show-progress-percentage-in-gradient-bar-2k61</link>
      <guid>https://dev.to/raisaugat/how-to-show-progress-percentage-in-gradient-bar-2k61</guid>
      <description>&lt;p&gt;Today we are going to build this with the help of react and Css variables. So let's get started.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kXwHFApj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/a2do69keizamu3whx15o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kXwHFApj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/a2do69keizamu3whx15o.png" alt="Alt Text" width="802" height="150"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The demo for the tutorial is &lt;a href="https://codesandbox.io/s/sad-rain-8d3qd"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Challenge
&lt;/h1&gt;

&lt;p&gt;If there were no segments, it'd have been easier to implement the progress bar. But the progress bar itself is divided into segment like in the picture above. So before writing the range function, there are some initialization to be done to know in which bar the percentage falls on. &lt;/p&gt;

&lt;h1&gt;
  
  
  Initializing essential variables
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g3vYO-o0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/7n3ado6xkegwd56bzbrn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g3vYO-o0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/7n3ado6xkegwd56bzbrn.png" alt="Alt Text" width="880" height="190"&gt;&lt;/a&gt;&lt;br&gt;
This variable gives us what 100% equals to in each bar. Since 100 / 7  = 14.28, each bar is 14.28%.&lt;/p&gt;

&lt;p&gt;TruePercent variable will hold the percent we want to show in the bar.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--up_fiPXD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dtfe9vgoyd6o7v84vue7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--up_fiPXD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dtfe9vgoyd6o7v84vue7.png" alt="Alt Text" width="880" height="176"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We also want to show the label in this case indicating high value, medium value or low value.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DABjy-Fh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3vlg5ambncyav6yewe30.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DABjy-Fh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3vlg5ambncyav6yewe30.png" alt="Alt Text" width="880" height="408"&gt;&lt;/a&gt;&lt;br&gt;
The rangeIndicator will give us the value of to which quartile or bar the percentage falls on. &lt;/p&gt;

&lt;p&gt;For example: &lt;br&gt;
&lt;em&gt;If the truePercent = 78, the rangeIndicator = 78/14.28 = 5.46 ~= 5. Thus the potentialLabel = 'medium'.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Creating Indicator
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DWp7Y6fS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ier1tiklfsxabrb95j4v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DWp7Y6fS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ier1tiklfsxabrb95j4v.png" alt="Alt Text" width="880" height="362"&gt;&lt;/a&gt;&lt;br&gt;
This will just render the indicator with low, medium or high text.&lt;/p&gt;

&lt;h1&gt;
  
  
  Creating the structure
&lt;/h1&gt;

&lt;p&gt;The structure is simple. All the work in done in the rangeArray function.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--D9DDSuUS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/q6oz88ev50ovzag1v07s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--D9DDSuUS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/q6oz88ev50ovzag1v07s.png" alt="Alt Text" width="880" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Main Function
&lt;/h1&gt;

&lt;p&gt;All the work is done in this function. The function is responsible for rendering the colored and empty bar.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Enh34KjL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ay6ud238sigzdhld9770.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Enh34KjL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ay6ud238sigzdhld9770.png" alt="Alt Text" width="880" height="1313"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's break the function into multiple parts.&lt;/p&gt;

&lt;p&gt;The loop basically runs from 1 to BAR_COUNT value.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KOltHRh9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zq2nxkas23pft58r9e94.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KOltHRh9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zq2nxkas23pft58r9e94.png" alt="Alt Text" width="880" height="129"&gt;&lt;/a&gt;&lt;br&gt;
This variable will give the percent which we'll compare with truePercent to know up to where the bar should be filled.&lt;br&gt;
i.e Math.round(1 * 14.28) = 14&lt;br&gt;
    Math.round(2 * 14.28) = 28.56 ~= 29 and so on.&lt;/p&gt;

&lt;p&gt;If the truePercent &amp;gt; currentPoint, we'll simply fill the bar.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Gz-LRH2p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/egtuzirpzvgkypfq8u4u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Gz-LRH2p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/egtuzirpzvgkypfq8u4u.png" alt="Alt Text" width="880" height="133"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If not, then further calculation needs to be done.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g4PQPMFz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lq6buoain9jfjy1c8yaz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g4PQPMFz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lq6buoain9jfjy1c8yaz.png" alt="Alt Text" width="880" height="329"&gt;&lt;/a&gt;&lt;br&gt;
The linear-gradient css property can be used to make different sorts of gradient effect. To achieve the effect of half filled and half empty, we need to know how much the filled percent is. The basic syntax for linear-gradient is &lt;/p&gt;

&lt;p&gt;&lt;em&gt;background-image: linear-gradient(90deg, color percent, white percent);&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Since we know the truePercent lies in 6th bar. We need to know up to which percent of 6th bar the color is filled. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KSnfiB1T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/92qdnrmio96ujnc1ngk3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KSnfiB1T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/92qdnrmio96ujnc1ngk3.png" alt="Alt Text" width="880" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above percent will become&lt;br&gt;
((78 - 72)/14) * 100 = 42.85 ~= 42&lt;/p&gt;

&lt;p&gt;Thus the percent for gradient is 42% and for white is (100-42) = 58% and the quartileValue = 6.&lt;/p&gt;

&lt;p&gt;Once we have percent and quartile value, now it's time to set the percent value to Css variable and push the remaining bar into the array. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8CWcndJe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/uk85hxp9ismvdegbls5e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8CWcndJe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/uk85hxp9ismvdegbls5e.png" alt="Alt Text" width="880" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When the loop reaches to the quartileValue, the root.style.setProperty will set the percent value to the ith block. The left value set above is use to position the indicator exactly at the gradient separation part. The element is then pushed into array and the class is set according to the condition satisfied.&lt;/p&gt;

&lt;p&gt;In this was, we can make progress bar indicator with the user defined percent value. Feel free to comment if the code is confusing :). &lt;/p&gt;

&lt;p&gt;I hope this tutorial will be useful for some of you in coming days. Will return soon with another tutorial.&lt;/p&gt;

</description>
      <category>react</category>
      <category>css</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to make Custom &lt;select&gt; but without using select?</title>
      <dc:creator>Saugat Rai</dc:creator>
      <pubDate>Thu, 31 Oct 2019 10:58:00 +0000</pubDate>
      <link>https://dev.to/raisaugat/how-to-make-custom-select-but-without-using-select-2hbf</link>
      <guid>https://dev.to/raisaugat/how-to-make-custom-select-but-without-using-select-2hbf</guid>
      <description>&lt;p&gt;How can I make a custom select component but without using  HTML tag? I have an input field and when searched it fetches data from API. The data are shown in separate div. I also tried datalist but no luck.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0m67zzsO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/p6ikytfbx7j2z7q0jqhh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0m67zzsO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/p6ikytfbx7j2z7q0jqhh.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>html</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>How do you configure eslint and prettier for react project?</title>
      <dc:creator>Saugat Rai</dc:creator>
      <pubDate>Sun, 01 Sep 2019 13:00:45 +0000</pubDate>
      <link>https://dev.to/raisaugat/how-do-you-configure-eslint-and-prettier-for-react-project-le9</link>
      <guid>https://dev.to/raisaugat/how-do-you-configure-eslint-and-prettier-for-react-project-le9</guid>
      <description>&lt;p&gt;I want to know how to configure eslint and prettier when starting a new project in react. I have read many blogs about how to do it but let's hear from our fellow developers. &lt;/p&gt;

</description>
      <category>react</category>
      <category>discuss</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Mac or linux or windows for development work?</title>
      <dc:creator>Saugat Rai</dc:creator>
      <pubDate>Wed, 07 Aug 2019 14:33:11 +0000</pubDate>
      <link>https://dev.to/raisaugat/mac-or-linux-or-windows-for-development-work-3mdo</link>
      <guid>https://dev.to/raisaugat/mac-or-linux-or-windows-for-development-work-3mdo</guid>
      <description>&lt;p&gt;For me, I use iMac in the office and windows at home. Personally, I was not fond of mac because it's expensive 😅 and you cannot play all games. 🎮&lt;br&gt;
But after using for almost 8 months at the office, I am kind of getting used to it and I think it is a good investment to buy a MacBook.&lt;/p&gt;

&lt;p&gt;Which platform do you prefer to work with? &lt;/p&gt;

</description>
      <category>discuss</category>
      <category>ubuntu</category>
      <category>linux</category>
    </item>
    <item>
      <title>How do you manage your sass/scss or any other styling files on react?</title>
      <dc:creator>Saugat Rai</dc:creator>
      <pubDate>Wed, 24 Jul 2019 04:05:56 +0000</pubDate>
      <link>https://dev.to/raisaugat/how-do-you-manage-your-sass-scss-or-any-other-styling-files-on-react-3h0m</link>
      <guid>https://dev.to/raisaugat/how-do-you-manage-your-sass-scss-or-any-other-styling-files-on-react-3h0m</guid>
      <description>&lt;p&gt;How do you structure your styling files on react? Do you use styled-components or do you use sass/scss? &lt;/p&gt;

</description>
      <category>discuss</category>
      <category>react</category>
    </item>
    <item>
      <title>How to work with SVG on react</title>
      <dc:creator>Saugat Rai</dc:creator>
      <pubDate>Sun, 14 Jul 2019 12:44:26 +0000</pubDate>
      <link>https://dev.to/raisaugat/how-to-work-with-svg-on-react-4kp4</link>
      <guid>https://dev.to/raisaugat/how-to-work-with-svg-on-react-4kp4</guid>
      <description>&lt;p&gt;SVGs are great. They are great to use for icons since they don't blur out when zoomed. We can change the fill color while adding hover effect and so much more.&lt;/p&gt;

&lt;p&gt;In this tutorial, we will be making a component that will render SVG icons and will also take color options so that we can the color.&lt;/p&gt;

&lt;h2&gt;
  
  
  ICONS
&lt;/h2&gt;

&lt;p&gt;First lets start off with a constant ICONS variables that will hold all the values of SVG like viewbox and path. Viewbox is necessary to define position and dimension.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbscvjt408efdz9i4tsc0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbscvjt408efdz9i4tsc0.png" width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapper
&lt;/h2&gt;

&lt;p&gt;In order to render SVG, we need wrapper. So we will make a wrapper file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flym0fo6tephxmf16x9da.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flym0fo6tephxmf16x9da.png" width="800" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This component will receive props like width, height, color and icon name. The width, height and icon name will be used in svg tag and the color will be used in path tag. Icon name can be anything as long as it is included in ICONS constant.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdynz0blw1o0sw0koem6k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdynz0blw1o0sw0koem6k.png" width="786" height="47"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will help to get the value of viewbox from the icon name provided. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmmnxejng79hsgho0fzkl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmmnxejng79hsgho0fzkl.png" width="800" height="52"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this will help to fill the color to SVG. If the color is not provided then the default color will be used. &lt;/p&gt;

&lt;p&gt;You can also define propType if you want to.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F42w9bpnsgezd2khl6s2y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F42w9bpnsgezd2khl6s2y.png" width="800" height="171"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F973i2v01baw5xa6k7doe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F973i2v01baw5xa6k7doe.png" width="691" height="133"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/35kyl"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;This tutorial was possible with the help of this medium article that I came across while searching.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/@david.gilbertson/icons-as-react-components-de3e33cb8792"&gt;https://medium.com/@david.gilbertson/icons-as-react-components-de3e33cb8792&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well, that's all for now. Will return soon with another tutorial. &lt;/p&gt;

</description>
      <category>react</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Was not able to comment out jsx in react, so I made my own snippets</title>
      <dc:creator>Saugat Rai</dc:creator>
      <pubDate>Thu, 04 Jul 2019 14:47:12 +0000</pubDate>
      <link>https://dev.to/raisaugat/was-not-able-to-comment-out-jsx-in-react-so-i-made-my-own-snippets-2853</link>
      <guid>https://dev.to/raisaugat/was-not-able-to-comment-out-jsx-in-react-so-i-made-my-own-snippets-2853</guid>
      <description>&lt;p&gt;While I was on a react project, I was not able to comment out jsx which was really frustrating. &lt;/p&gt;

&lt;p&gt;The way we comment out jsx is&lt;br&gt;
&lt;code&gt;{/* comment */}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;But the default comment function on vscode doesnot comment out jsx. So, I made my own snippets to comment out jsx. &lt;/p&gt;

&lt;p&gt;First, open command palette&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftwr7gox7txgou6dg393c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftwr7gox7txgou6dg393c.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Search for configure user snippets. But before choosing, look for the language type on your work file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Frkg2czlkqde414wb5hnx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Frkg2czlkqde414wb5hnx.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then choose javascript or javascriptreact.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fbwgcm1sqlz0gjod4hh4c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fbwgcm1sqlz0gjod4hh4c.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that you will see some examples of how you can make a snippets. Copy below code and paste it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"Comment out jsx": {&lt;br&gt;
 "prefix": "jsx",&lt;br&gt;
 "body": [&lt;br&gt;
           "{/*",&lt;br&gt;
       "${TM_SELECTED_TEXT}",&lt;br&gt;
       "*/}"&lt;br&gt;
      ],&lt;br&gt;
 "description": "Comment out jsx"&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Save the file and you are good to go. &lt;/p&gt;

&lt;p&gt;Select the code you want to comment and insert snippets. &lt;/p&gt;

</description>
      <category>vscode</category>
      <category>productivity</category>
      <category>react</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Explain like I'm five what is monorepo</title>
      <dc:creator>Saugat Rai</dc:creator>
      <pubDate>Tue, 25 Jun 2019 15:46:07 +0000</pubDate>
      <link>https://dev.to/raisaugat/explain-like-i-m-five-what-is-monorepo-4kkh</link>
      <guid>https://dev.to/raisaugat/explain-like-i-m-five-what-is-monorepo-4kkh</guid>
      <description></description>
      <category>explainlikeimfive</category>
    </item>
    <item>
      <title>Weekly blog sharing culture</title>
      <dc:creator>Saugat Rai</dc:creator>
      <pubDate>Mon, 24 Jun 2019 06:15:00 +0000</pubDate>
      <link>https://dev.to/raisaugat/weekly-blog-sharing-culture-44bb</link>
      <guid>https://dev.to/raisaugat/weekly-blog-sharing-culture-44bb</guid>
      <description>&lt;p&gt;Recently, the place where I work is coming up with this weekly blog sharing culture. The blog includes the contents that frontenders, designers and backenders gather throughout the week. &lt;/p&gt;

&lt;p&gt;Here is the link for &lt;a href="https://medium.com/@rai.saugat.sr/frontend-design-knowledge-sharing-4-9fde634d374e"&gt;frontend-designer sharing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is the link for &lt;a href="https://blog.yipl.com.np/backend-knowledge-sharing-4-cda62c176f79"&gt;backend sharing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This culture has been fruitful to all of us. Are there any sharing culture around your work area? &lt;/p&gt;

&lt;p&gt;Feel free to share. :) &lt;/p&gt;

</description>
      <category>discuss</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to get motivated to code?</title>
      <dc:creator>Saugat Rai</dc:creator>
      <pubDate>Sun, 23 Jun 2019 14:33:25 +0000</pubDate>
      <link>https://dev.to/raisaugat/how-to-get-motivated-to-code-3mh8</link>
      <guid>https://dev.to/raisaugat/how-to-get-motivated-to-code-3mh8</guid>
      <description>&lt;p&gt;How do you all get motivated to learn and code? Recently I have not been able to focus on my coding journey. &lt;/p&gt;

&lt;p&gt;Any tips and tricks you'd like to share?&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
  </channel>
</rss>
