<?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: Edgar Carrillo</title>
    <description>The latest articles on DEV Community by Edgar Carrillo (@edgarcodes).</description>
    <link>https://dev.to/edgarcodes</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%2F777807%2Fbe2ee59e-188f-43c0-8b42-7c6f723d2c94.png</url>
      <title>DEV Community: Edgar Carrillo</title>
      <link>https://dev.to/edgarcodes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/edgarcodes"/>
    <language>en</language>
    <item>
      <title>How to: work on two or more folders at the same time in VSCode</title>
      <dc:creator>Edgar Carrillo</dc:creator>
      <pubDate>Sat, 25 Feb 2023 02:05:22 +0000</pubDate>
      <link>https://dev.to/edgarcodes/how-to-work-on-two-or-more-folders-at-the-same-time-in-vscode-4bcg</link>
      <guid>https://dev.to/edgarcodes/how-to-work-on-two-or-more-folders-at-the-same-time-in-vscode-4bcg</guid>
      <description>&lt;h1&gt;
  
  
  Explanation
&lt;/h1&gt;

&lt;p&gt;Ever been in a situation where you're front-end code and your back-end code are in different folders? &lt;/p&gt;

&lt;p&gt;Then you find yourself with the pain of going back and forth between two vscode editors?&lt;/p&gt;

&lt;p&gt;With Multi-root Workspaces you can work on multiple folders all within one editor, here's how!&lt;/p&gt;

&lt;h1&gt;
  
  
  Steps to create Workspace
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1.
&lt;/h2&gt;

&lt;p&gt;Go to the location where your front-end and back-end folders are stored within terminal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--d81Ujgj_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j17z8w22xfc405ilv3rp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--d81Ujgj_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j17z8w22xfc405ilv3rp.png" alt="Mac Terminal showing front-end and back-end code folders" width="880" height="588"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2.
&lt;/h2&gt;

&lt;p&gt;Open one of the folders with vscode.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P8ijGyTB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/40ys5uld7i18pzdrgr2t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P8ijGyTB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/40ys5uld7i18pzdrgr2t.png" alt="Image description" width="880" height="585"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3.
&lt;/h2&gt;

&lt;p&gt;Within vscode click &lt;code&gt;command&lt;/code&gt; + &lt;code&gt;p&lt;/code&gt; to open a search bar. Within the search bar type &lt;code&gt;&amp;gt;add folder to workspace&lt;/code&gt; and click on the result that pops up.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--h-FeXQvG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uelovdac60nds8w2on9b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--h-FeXQvG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uelovdac60nds8w2on9b.png" alt="Image description" width="880" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4.
&lt;/h2&gt;

&lt;p&gt;Your folders will popup. Select the folders you want to work on at the same time, then click add.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--F-vhgFpL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mcniacniyw0bgtrk3lsd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--F-vhgFpL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mcniacniyw0bgtrk3lsd.png" alt="Image description" width="880" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5.
&lt;/h2&gt;

&lt;p&gt;Again, open the search bar in vscode with &lt;code&gt;command&lt;/code&gt; + &lt;code&gt;p&lt;/code&gt; and search for &lt;code&gt;&amp;gt;add folder to workspace&lt;/code&gt; and click on the result.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YXhd3FA_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lbujfmlq7ayu9qv45l15.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YXhd3FA_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lbujfmlq7ayu9qv45l15.png" alt="Image description" width="880" height="486"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6.
&lt;/h2&gt;

&lt;p&gt;A popup will appear. Name the workspace that houses your multiple folders how you like. And also make sure to choose where you'd like to store this workspace then save.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KCi92nq_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n7bvdecx97n0y94ohhgf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KCi92nq_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n7bvdecx97n0y94ohhgf.png" alt="Image description" width="714" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  How to access workspace
&lt;/h1&gt;

&lt;p&gt;If you completed the 5 steps to create workspace you're ready to go! &lt;/p&gt;

&lt;p&gt;What you did was create a workspace that references your multiple folders. To use it go to the location you saved the workspace at using terminal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fy5hlg7k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vtjaq5w3d0c2oxjdel3d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fy5hlg7k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vtjaq5w3d0c2oxjdel3d.png" alt="Image description" width="880" height="591"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now treat it like opening a file, open it with vscode and you're ready to go!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QruGG6C8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ciupoydgsbmmrcs6sdd2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QruGG6C8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ciupoydgsbmmrcs6sdd2.png" alt="Image description" width="880" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W1x0fg9f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xr3nj97qxkugvhxj82vr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W1x0fg9f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xr3nj97qxkugvhxj82vr.png" alt="Image description" width="880" height="506"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>git</category>
      <category>vscode</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to find and kill a process locking a port on Mac</title>
      <dc:creator>Edgar Carrillo</dc:creator>
      <pubDate>Wed, 19 Oct 2022 16:16:51 +0000</pubDate>
      <link>https://dev.to/edgarcodes/how-to-find-and-kill-a-process-locking-a-port-on-mac-1bin</link>
      <guid>https://dev.to/edgarcodes/how-to-find-and-kill-a-process-locking-a-port-on-mac-1bin</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Many of us have probably tried running our server on a port such as &lt;code&gt;localhost:3000&lt;/code&gt; or development environment on the same port. &lt;/p&gt;

&lt;p&gt;There's also the time where we closed our terminal without killing our port. This brings up a:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;EADDRINUSE: address already in use :::3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;...error message (your port number could be different)&lt;/p&gt;

&lt;p&gt;This quick guide will show you how to find the port and kill it in two simple commands.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Get the PID of the port you want to kill. In terminal type the following
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo lsof -i :3000 # The port # here should be the one giving issue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A series of information should appear on your screen. Take note of the PID number.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Type the following command to kill the port with the PID you specified:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kill -9 &amp;lt;PID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Now since you killed the port you should be free to reuse it!&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/3855127/find-and-kill-process-locking-port-3000-on-mac"&gt;Find (and kill) process locking port 3000 on Mac [closed]&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Can't install Node below version 15? Here's how.</title>
      <dc:creator>Edgar Carrillo</dc:creator>
      <pubDate>Fri, 23 Sep 2022 01:15:06 +0000</pubDate>
      <link>https://dev.to/edgarcodes/cant-install-node-below-version-15-heres-how-14pm</link>
      <guid>https://dev.to/edgarcodes/cant-install-node-below-version-15-heres-how-14pm</guid>
      <description>&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;p&gt;In order to continue with this article please have &lt;a href="https://github.com/nvm-sh/nvm#readme"&gt;nvm&lt;/a&gt; installed on your device.&lt;/p&gt;

&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;If you have an &lt;a href="https://support.apple.com/en-us/HT211814"&gt;Apple Silicon Device&lt;/a&gt; (usually newer MacBooks) you probably saw an error when trying to install Node below version 15 (Like v14.0.0) with &lt;a href="https://github.com/nvm-sh/nvm#readme"&gt;nvm&lt;/a&gt;. Here's how to get past that error and install node below version 15.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;First you want to install Rosetta. To do this open Terminal and type in the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;softwareupdate --install-rosetta
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, you will need to go to your Applications folder on your device and find Terminal. If your Mac was setup like mine it will be in a nested folder within applications.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Applications -&amp;gt; Utilities -&amp;gt; Terminal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you see the terminal icon, right click on it, click on &lt;code&gt;Get Info&lt;/code&gt; and select &lt;code&gt;Open using Rosetta&lt;/code&gt;. Then restart your terminal.&lt;/p&gt;

&lt;p&gt;Now open terminal back up and run the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;arch -x86_64 zsh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your device should now be able to install Node below version 15!&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/67254339/nvm-install-node-fails-to-install-on-macos-big-sur-m1-chip"&gt;Stackoverflow&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>SSH into AWS: EC2 instances easily!</title>
      <dc:creator>Edgar Carrillo</dc:creator>
      <pubDate>Thu, 28 Apr 2022 16:48:06 +0000</pubDate>
      <link>https://dev.to/edgarcodes/how-to-ssh-into-ec2-instances-easily-2708</link>
      <guid>https://dev.to/edgarcodes/how-to-ssh-into-ec2-instances-easily-2708</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;This tutorial will show you how to login to your ec2 instance without having to do &lt;code&gt;ssh ./pem.key ubuntu@0.00.00.0&lt;/code&gt; each time.&lt;/p&gt;

&lt;p&gt;With this easy to setup method you can &lt;strong&gt;login to any number of ec2 instances with a simple command for each instance&lt;/strong&gt;. No installs needed!&lt;/p&gt;

&lt;p&gt;going from this&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ssh ./pem.key ubuntu@0.00.00.0&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;to this&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ssh api-one-ec2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;(you can name your entry point whatever you'd like)&lt;/p&gt;

&lt;h2&gt;
  
  
  Tutorial
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Things you need
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The absolute path to your pem file related to the ec2 instance you want to login to.&lt;/li&gt;
&lt;li&gt;The IPv4 address of your ec2 aws instance.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Steps
&lt;/h3&gt;

&lt;p&gt;First edit your ssh config file in vscode. To do this type in the following&lt;/p&gt;

&lt;p&gt;&lt;code&gt;code ~/.ssh/config&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Something like this should popup&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xZrFmtzZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vj88qqd6zzb3i3rsxwf5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xZrFmtzZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vj88qqd6zzb3i3rsxwf5.png" alt="VS Code Editor ssh config screen" width="880" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then you're going to add and fill in some syntax&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--u-Uz8cC6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xz93aguh5dzkhzhfs9qb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--u-Uz8cC6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xz93aguh5dzkhzhfs9qb.png" alt="vscode - ssh config syntax" width="587" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Host&lt;/code&gt; will be the shorthand text you type to log into your instance from anywhere in terminal.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;HostName&lt;/code&gt; This you need to get from aws. It's the Public IPv4 address of the instance you want to login to.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;User&lt;/code&gt; This is your instance user. If you created a ubuntu instance keep it as ubuntu.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;IdentityFile&lt;/code&gt; This is going to be the location where your pem key resides. Make sure to use an absolute path to your pem key. Here's a &lt;a href="https://www.quora.com/What-does-mean-in-a-directory-path"&gt;good article&lt;/a&gt; that describes what the &lt;code&gt;~&lt;/code&gt; key is in this path.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;IdentitiesOnly&lt;/code&gt; just keep it as yes for now. I'll update why soon.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once all this is filled out then you can now login to your ec2 instance from anywhere! With the example I provided I would just type &lt;code&gt;ssh api-on-ec2&lt;/code&gt; and I'm in!&lt;/p&gt;

&lt;p&gt;I no longer have to type &lt;code&gt;ssh ./pathToPem.pem ubuntu@00.000.00.000&lt;/code&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  Cautions
&lt;/h2&gt;

&lt;p&gt;There will be times where your IPv4 address will change such as stopping your ec2 instance. In this case all you have to do is update your &lt;code&gt;HostName&lt;/code&gt; in the ssh config to the new address and you're good to go!&lt;/p&gt;

&lt;p&gt;Same goes for your pem file, make sure that if you move it to another location to also update &lt;code&gt;IdentifyFile&lt;/code&gt; pem path in ssh config to reflect the new location. &lt;/p&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Dynamic Item Selection: Made with React Hooks</title>
      <dc:creator>Edgar Carrillo</dc:creator>
      <pubDate>Wed, 12 Jan 2022 04:15:05 +0000</pubDate>
      <link>https://dev.to/edgarcodes/dynamic-item-selection-made-with-react-hooks-3kfl</link>
      <guid>https://dev.to/edgarcodes/dynamic-item-selection-made-with-react-hooks-3kfl</guid>
      <description>&lt;h2&gt;
  
  
  TLTR
&lt;/h2&gt;

&lt;p&gt;Jump to &lt;strong&gt;Quick Explanation&lt;/strong&gt; below to get a 15 second explanation.&lt;/p&gt;

&lt;p&gt;Just want to see it in action? Try out the &lt;a href="https://dynamic-item-selection.netlify.app/"&gt;deployed demo&lt;/a&gt;. Want a deep dive? Take a peek at &lt;a href="https://github.com/ec-rilo/dynamic-nav-menu-items"&gt;the repo&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;p&gt;You're required to know the below in order to understand what I'm going to be explaining in this article:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React Hooks&lt;/li&gt;
&lt;li&gt;React Functional Components&lt;/li&gt;
&lt;li&gt;Styled-Components&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understand the above? Great, keep reading! If you don't I'd do some quick googling to learn about them or for a refresher.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Explanation
&lt;/h2&gt;

&lt;p&gt;This Hook allows the user to create an 'n' number of list items that on hover will emphasize the hovered list item and dim all other elements.&lt;/p&gt;

&lt;p&gt;When the user no longer is hovering over a list item all elements will return to the default coleration.&lt;/p&gt;

&lt;p&gt;This hook also pairs with a styled component, in this case it's called TextAnimateLi which is hard coded to fit my styling needs but can be changed to your style and element preference.&lt;/p&gt;

&lt;h2&gt;
  
  
  useTextAnimate
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;useTextAnimate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setContent&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;setOneActive&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;contentCopy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="nx"&gt;contentCopy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;isActive&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nx"&gt;setContent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;contentCopy&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;setAllActive&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;contentCopy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="nx"&gt;contentCopy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;isActive&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nx"&gt;setContent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;contentCopy&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;setOneActive&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setAllActive&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This hook when used takes in an array of objects as it's argument.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useTextAnimate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;work&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;isActive&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;about&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;isActive&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From here, we're assigning the array of objects &lt;code&gt;data&lt;/code&gt; to &lt;code&gt;content&lt;/code&gt; in state. This allows us to use stateful logic needed for dynamic style changing.&lt;/p&gt;

&lt;p&gt;Then we come onto our first function &lt;code&gt;setOneActive&lt;/code&gt; which will set all elements but the one with the matching name to false. This is the logic that allows us to see one element as emphasized.&lt;/p&gt;

&lt;p&gt;The following function &lt;code&gt;setAllActive()&lt;/code&gt; will set all items to be emphasized which is the default logic.&lt;/p&gt;

&lt;p&gt;what is returned is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;content&lt;/code&gt; - array of objects that the user provided.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;setOneActive&lt;/code&gt; - function&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;setAllActive&lt;/code&gt; - function&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Real Life use
&lt;/h2&gt;

&lt;p&gt;When using the hook it will take in an array of objects as an argument.&lt;/p&gt;

&lt;p&gt;Each object must contain the following properties&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;name (Init with the text you want in the list item)&lt;/li&gt;
&lt;li&gt;isActive (set it to true by default always)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useTextAnimate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;work&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;isActive&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;about&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;isActive&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;contact&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;isActive&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;isActive&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: the value retrieved from useTextAnimate must be assigned to a variable.&lt;/p&gt;

&lt;p&gt;useTextContent will return 3 things.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;content (the array of objects from earlier)&lt;/li&gt;
&lt;li&gt;setOneActive (Explained in useTextAnimate above)&lt;/li&gt;
&lt;li&gt;setAllActive (Explained in useTextAnimate above)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The hook provided the logic needed now we are going to populate a unordered list with list items that will use that logic.&lt;/p&gt;

&lt;p&gt;Before we start using the logic we are going to need the styled-component TextAnimateLi.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;TextAnimateLi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt;&lt;span class="s2"&gt;`
  color: white;
  transition: color 0.2s;
  cursor: pointer;
  &lt;/span&gt;&lt;span class="p"&gt;${({&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;isActive&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`
      color: rgba(255, 255, 255, 0.5);  
    `&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="s2"&gt;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To keep it short and sweet. It uses data provided by useTextAnimate to style each list item dynamically.&lt;/p&gt;

&lt;p&gt;Now in order to put this together, we need to map over the array we created in my example, we can do this with &lt;code&gt;data.content&lt;/code&gt; (Remember, using the variable name &lt;code&gt;data&lt;/code&gt; was a personal choice when creating the variable earlier. It can be anything you'd like!)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;TextAnimateLi&lt;/span&gt;
            &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nx"&gt;onMouseEnter&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setOneActive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
            &lt;span class="nx"&gt;onMouseLeave&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setAllActive&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;
            &lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/TextAnimateLi&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;})}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What's going on here? The parameter &lt;code&gt;item&lt;/code&gt; in the arrow function is the current object within the array content.&lt;/p&gt;

&lt;p&gt;For each Component TextAnimateLi we are adding a set of properties.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;key&lt;/code&gt;&lt;br&gt;
MUST take index as it's value, do NOT use something like uniqid()).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;onMouseEnter&lt;/code&gt;&lt;br&gt;
Calls the function &lt;code&gt;setOneActive()&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;onMouseLeave&lt;/code&gt;&lt;br&gt;
Calls the function &lt;code&gt;setAllActive()&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;content&lt;/code&gt;&lt;br&gt;
takes in the array of objects&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;index&lt;/code&gt;&lt;br&gt;
Takes the current index&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's take a look back at TextAnimateLi to understand the styling logic.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/* It doesn't have to be a li. But for this case it's the best option. */&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;TextAnimateLi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt;&lt;span class="s2"&gt;`
  /* This is the default color */
  /* You can set a new color here */
  color: white;
  transition: color 0.2s;
  cursor: pointer;
  &lt;/span&gt;&lt;span class="p"&gt;${({&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;isActive&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`
      /* This is the dimming color */
      /* You can set a new color here */
      color: rgba(255, 255, 255, 0.5);  
    `&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="s2"&gt;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pretty straight forward, when the current item is not active it will return a color which is dimmed otherwise, it will return to it's default color.&lt;/p&gt;

&lt;p&gt;Take a look at my comments in the code to make changes as you see fit. feel free to mess around with the styling for different looks!&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>react</category>
      <category>html</category>
    </item>
    <item>
      <title>Understanding the .valueOf() method (Currying anyone?)</title>
      <dc:creator>Edgar Carrillo</dc:creator>
      <pubDate>Tue, 28 Dec 2021 18:34:15 +0000</pubDate>
      <link>https://dev.to/edgarcodes/understanding-the-valueof-method-currying-anyone-21cb</link>
      <guid>https://dev.to/edgarcodes/understanding-the-valueof-method-currying-anyone-21cb</guid>
      <description>&lt;h1&gt;
  
  
  Requirements
&lt;/h1&gt;

&lt;p&gt;You're required to know the below in order to understand what I'm going to be explaining in this article:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ES6 Arrow functions&lt;/li&gt;
&lt;li&gt;Closures&lt;/li&gt;
&lt;li&gt;Callbacks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understand the above? Great, keep reading! If you don't I'd do some quick googling to learn about them or for a refresher.&lt;/p&gt;

&lt;h1&gt;
  
  
  Story and why I wrote this
&lt;/h1&gt;

&lt;p&gt;While completing my daily codewars.com questions I came up on the question &lt;a href="https://www.codewars.com/kata/539a0e4d85e3425cb0000a88/javascript"&gt;A chain adding function&lt;/a&gt;. It had code I never saw before.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;add(1)(2)(3); // 6
add(1)(2)(3)(4); // 10
add(1)(2)(3)(4)(5); // 15
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;???&lt;/p&gt;

&lt;p&gt;Like any good developer I did some headbanging trying to figure it out before I jumped into google to see what was going on.&lt;/p&gt;

&lt;p&gt;Enter &lt;a href="https://javascript.info/currying-partials"&gt;Currying&lt;/a&gt;.&lt;br&gt;
And more learning about &lt;a href="https://www.youtube.com/watch?v=iZLP4qOwY8I&amp;amp;ab_channel=FunFunFunction"&gt;currying&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After researching currying I had a pretty solid understanding of it even with it's confusion of calling a function that returns a function that calls a function that... you get the point. (If not, check out the currying links above!)&lt;/p&gt;

&lt;p&gt;Now lets get back to the codewars problem, yea it's cool that we know about currying but how do we solve a problem were...&lt;/p&gt;
&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;... a transformation of functions is created where we don't know the amount of arguments that are to be used? &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Currying is a transformation of functions that translates a function from callable as f(a, b, c) into callable as f(a)(b)(c).&lt;br&gt;
Quote from - &lt;a href="https://javascript.info/currying-partials"&gt;Javascript.info, Currying&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  The Solution and explanation ✅ (What you prob wanted to know)
&lt;/h2&gt;

&lt;p&gt;So how do we solve the problem!?!?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf"&gt;&lt;code&gt;.valueOf()&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Get it? The mdn article on &lt;code&gt;.valueOf()&lt;/code&gt; threw me for a loop the first read around to.&lt;/p&gt;

&lt;p&gt;I'm going to explain in my own code how I used it in the &lt;a href="https://www.codewars.com/kata/539a0e4d85e3425cb0000a88/javascript"&gt;codewars.com problem&lt;/a&gt; from above.&lt;/p&gt;

&lt;p&gt;Here's the solution&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;func&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;func&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;func&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;valueOf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;func&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's take it step by step.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;I declared a result variable that will hold my final result after currying is complete.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I declared a function &lt;code&gt;func&lt;/code&gt; using es6 arrow functions that creates a closure where result is consistently changing when &lt;code&gt;func&lt;/code&gt; is called. The return value is &lt;code&gt;func&lt;/code&gt; itself. Note - the function &lt;code&gt;add()&lt;/code&gt; does not end here! it keeps going. I hope you understand why, if not, discuss in the comments :)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;❗ This is what you're looking for to understand &lt;code&gt;.valueOf()&lt;/code&gt; ❗&lt;/strong&gt; - We add .valueOf to the &lt;code&gt;func&lt;/code&gt; function. and in that closure we return &lt;code&gt;result&lt;/code&gt;. What we are doing is overwriting the .valueOf method to return result once the callbacks have ended in the curry.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We return the &lt;code&gt;func&lt;/code&gt; function - which will continue to repeat until there are no arguments left to do callbacks. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In summary, .valueOf() when in relation to functions will return a primitive value once there are no callbacks left to do.&lt;/p&gt;

&lt;p&gt;A quote that made me understand &lt;code&gt;.valueOf&lt;/code&gt; that's related to the &lt;a href="https://www.codewars.com/kata/539a0e4d85e3425cb0000a88/javascript"&gt;codewars.com problem&lt;/a&gt; mentioned throughout the article is from user &lt;a href="https://www.codewars.com/users/gelus"&gt;gelus&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;So the key is to have a function that returns a function that has the valueOf method overwritten to return the current "value". ( phew )&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Read the quote slowly, it's a bit to take in but it shows the use of valueOf in action.&lt;/p&gt;

&lt;p&gt;Happy Coding!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Web-Dev Journey: Blog 1</title>
      <dc:creator>Edgar Carrillo</dc:creator>
      <pubDate>Mon, 20 Dec 2021 19:43:46 +0000</pubDate>
      <link>https://dev.to/edgarcodes/web-dev-journey-blog-1-237h</link>
      <guid>https://dev.to/edgarcodes/web-dev-journey-blog-1-237h</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br&gt;
Hey everyone, I decided to start my web development journey to be able to look back at how far I've come as I develop new skills.&lt;/p&gt;

&lt;p&gt;Some background about me, I'm the oldest of three children in my family, first generation here in the United States. Life started out rougher but my family knew that education and persistence is key to making something of yourself. Throughout life they have fought for me and now that I'm older I'm always wanting to find ways to give back. Not just to them but to my community that helped me become the man I am today.&lt;/p&gt;

&lt;p&gt;And now I've been invested in web development, something that allows me to bring tech to my non-tech community and to have the freedom to also do what I love, problem solving!&lt;/p&gt;

&lt;p&gt;With these blogs that I create I'll be documenting my journey through web development - the challenges I face, the things I discover, the creations I make, everything. As well as random posts on topics I'm learning/learned and to improve my writing and story telling skills.&lt;/p&gt;

&lt;p&gt;So sit back, grab your laptop and your best coffee, and welcome to my web development life!&lt;/p&gt;

&lt;p&gt;I hope to be able to relate to many others in this journey.&lt;/p&gt;

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