<?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: Jackson Reeves</title>
    <description>The latest articles on DEV Community by Jackson Reeves (@jtreeves).</description>
    <link>https://dev.to/jtreeves</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%2F581863%2F32537995-a3e4-4efc-b9fd-7212981aa820.jpeg</url>
      <title>DEV Community: Jackson Reeves</title>
      <link>https://dev.to/jtreeves</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jtreeves"/>
    <language>en</language>
    <item>
      <title>React Components vs. Normal Functions and the Props Parameter</title>
      <dc:creator>Jackson Reeves</dc:creator>
      <pubDate>Fri, 27 Jan 2023 01:47:34 +0000</pubDate>
      <link>https://dev.to/jtreeves/react-components-vs-normal-functions-1bl8</link>
      <guid>https://dev.to/jtreeves/react-components-vs-normal-functions-1bl8</guid>
      <description>&lt;p&gt;Moving from vanilla JavaScript to React can be a difficult mental lift for most beginner programmers. However, a lot of the mystique can be chocked up to syntactical differences, especially when it comes to the concept of props. Keep these two things in mind if you get thrown by React's props:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It's just a parameter. React's syntax may obscure that, but it's always just a parameter.&lt;/li&gt;
&lt;li&gt;It's just an object. And like all other JavaScript objects, it consists of key-value pairs. React has you build that object in an unconventional way, but it's always just an object.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To help demystify React's props, I'm going to compare a vanilla JavaScript function with a React component. I'll demonstrate how they're built and invoked to emphasize their similarities and differences. Each main function will take a dog object as a parameter, then display something about that dog. And each main function will then be called in another function that will display information about many dogs. I'll also provide a mocked up data file with info about a few dogs, which will be used in both scenarios. For simplicity, assume all files are in the same folder, and that in both scenarios, there exists a main app file that imports and invokes the parent function to finally render the info. Try to ignore the &lt;code&gt;document.createElement&lt;/code&gt;s in the vanilla functions (they're only included to make the examples more parallel) and instead focus on the props.&lt;/p&gt;

&lt;h1&gt;
  
  
  Data
&lt;/h1&gt;

&lt;p&gt;Creating a bunch of dogs (in &lt;code&gt;data.js&lt;/code&gt; file):&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;firstDog&lt;/span&gt; &lt;span class="o"&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;Lassie&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;breed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;collie&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;12&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;secondDog&lt;/span&gt; &lt;span class="o"&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;Bobo&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;breed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;terrier&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&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;thirdDog&lt;/span&gt; &lt;span class="o"&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;Sunny&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;breed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;shepherd&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;7&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;dogs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;firstDog&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;secondDog&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;thirdDog&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;dogs&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Vanilla JavaScript Function
&lt;/h1&gt;

&lt;p&gt;Creating the function (in &lt;code&gt;dog.js&lt;/code&gt; file):&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;normalishDogFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Actually using the props object&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;statement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`Hello! I'm a &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;breed&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;. My name is &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;props&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="s2"&gt;, and I am &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; years old. Bark!`&lt;/span&gt;

  &lt;span class="c1"&gt;// Creating a DOM node and adding text content to it the old-fashioned way, so this function can display something to the screen&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;li&lt;/span&gt;&lt;span class="dl"&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;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;statement&lt;/span&gt;

  &lt;span class="c1"&gt;// Returning DOM element to display, just like in React&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;normalishDogFunction&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using the function (in &lt;code&gt;dogList.js&lt;/code&gt; file):&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="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;dogs&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./data.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;normalishDogFunction&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./dog.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;normalishDogListFunction&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Create a DOM node the old-fashioned way&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ul&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="nx"&gt;dogs&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;dog&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Invoke the main function by passing it one of the imported objects; using forEach instead of map for simplicity's sake&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dogItem&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;normalishDogFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dog&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dogItem&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;list&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;normalishDogListFunction&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  React Functional Component
&lt;/h1&gt;

&lt;p&gt;Creating the component (in &lt;code&gt;Dog.jsx&lt;/code&gt; file):&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;ReactishDogComponent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Actually using the props object, and in the exact same way as with the vanilla version&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;statement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`Hello! I'm a &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;breed&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;. My name is &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;props&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="s2"&gt;, and I am &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; years old. Bark!`&lt;/span&gt;

  &lt;span class="c1"&gt;// Use JSX syntax to return a virtual node without interacting with the actual document&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;li&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;statement&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;/li&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="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;ReactishDogComponent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using the component (in &lt;code&gt;DogList.jsx&lt;/code&gt; file):&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="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;dogs&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./data.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;ReactishDogComponent&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./Dog&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;ReactishDogListComponent&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;dogList&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;dogs&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;dog&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Invoke the main component by passing it one of the imported objects&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ReactishDogComponent&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;dog&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;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;dog&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;age&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;dog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="nx"&gt;breed&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;dog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;breed&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;})&lt;/span&gt;

  &lt;span class="c1"&gt;// Again, use JSX syntax to return a virtual node without interacting with the actual document&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;ul&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;dogList&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;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;ReactishDogListComponent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Analysis
&lt;/h1&gt;

&lt;p&gt;When it comes to the props, here are some key similarities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In both cases, the main function just takes a single argument (props)&lt;/li&gt;
&lt;li&gt;In both cases, the main function accesses values on the props object by using dot notation&lt;/li&gt;
&lt;li&gt;In both cases, the main function must be called in another function, in which it receives the props it will end up using&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, the key difference for the props object:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In vanilla JavaScript, you pass the entire object as a single entity to the main function&lt;/li&gt;
&lt;li&gt;In React, you individually pass each of the properties that will exist on the props object to the main component; in essence, you build the props object within the main component's invocation&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Advanced
&lt;/h1&gt;

&lt;p&gt;The biggest trick with props is a direct consequence of the previously noted difference. Since you are passing the props object directly with vanilla JavaScript, the keys will end up exactly matching. Since you are creating the props object afresh with each invocation of the React component, you can make the keys differ if desired.&lt;/p&gt;

&lt;p&gt;If you choose that approach, just remember that the key (what's before the equals sign in the invocation within the parent) must match the name of the property on the props object (what comes after &lt;code&gt;props.&lt;/code&gt; in the component), while the value (what comes after the equals sign) must match something within the scope of the parent component.&lt;/p&gt;

&lt;p&gt;For instance, you could have the following parent component:&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;SomeOtherParent&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;emotions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;happy&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sad&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;angry&lt;/span&gt;&lt;span class="dl"&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;list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;emotions&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;singleEmotion&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;SomeOtherChild&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;singleEmotion&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="nx"&gt;currentEmotion&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;singleEmotion&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&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;ul&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;list&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;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;And pair it with the following child component:&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;SomeOtherChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&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;isHappy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;currentEmotion&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;happy&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;statement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`I'm &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;isHappy&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;not&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; happy!`&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;li&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;statement&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;/li&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works since the key is established as &lt;code&gt;currentEmotion&lt;/code&gt; in the invocation of the child component within the parent component, and it is then referenced via &lt;code&gt;props.currentEmotion&lt;/code&gt; in the child component. Similarly, the value is established as &lt;code&gt;singleEmotion&lt;/code&gt; in the invocation of the child component, which is a value accessible to that invocation at that level of scope within the parent component.&lt;/p&gt;

&lt;p&gt;Note that if you tried to use &lt;code&gt;props.singleEmotion&lt;/code&gt; or &lt;code&gt;props.emotion&lt;/code&gt; (or any other permutation of that) in the child component, you would get an error because those keys do not exist on the component's props object.&lt;/p&gt;

&lt;p&gt;Hopefully that helps to demystify props, but feel free to let me know about any confusion that persists, and I'll try to update this post to further clarify.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>props</category>
      <category>parameter</category>
    </item>
    <item>
      <title>Add Version Control and Remote Access to a Plain Repo</title>
      <dc:creator>Jackson Reeves</dc:creator>
      <pubDate>Sat, 02 Oct 2021 19:13:39 +0000</pubDate>
      <link>https://dev.to/jtreeves/add-version-control-and-remote-access-to-a-plain-repo-3102</link>
      <guid>https://dev.to/jtreeves/add-version-control-and-remote-access-to-a-plain-repo-3102</guid>
      <description>&lt;p&gt;Here's a super simple tutorial for beginners. So simple that it's essentially exactly what GitHub posts on its site to help people out with this exact situation. I merely added three lines of commands to fill in some unfortunate gaps.&lt;/p&gt;

&lt;h1&gt;
  
  
  Scenario
&lt;/h1&gt;

&lt;p&gt;You have a repo on your computer with all the code you need for your project. It works great. The only downside? It doesn't have any version control. As in, it ain't a Git repo. As a result, it also isn't shared anywhere (e.g., GitHub). You want to fix this, but how?&lt;/p&gt;

&lt;p&gt;If you log in to your GitHub account and create a new repo, it gives you three different options for building out your shiny new remote repo. The second option makes the most sense for this scenario: "…or push an existing repository from the command line." You do have an existing repo, and you do love the command line. However, if you merely &lt;code&gt;cd&lt;/code&gt; into your existing repo and run the three commands that GitHub provides, you'll quickly see that you actually need do a few more steps to accomplish your goal.&lt;/p&gt;

&lt;h1&gt;
  
  
  Solution
&lt;/h1&gt;

&lt;p&gt;Here's my full guide to Git-ifying an existing repo and migrating it to GitHub.&lt;/p&gt;

&lt;p&gt;After logging in to your GitHub account and creating a new repo, go back to your Terminal app and &lt;code&gt;cd&lt;/code&gt; into your local repo. Then:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;git init&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git remote add origin https://github.com/&amp;lt;YOURUSERNAME&amp;gt;/&amp;lt;YOURREPONAME&amp;gt;.git&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git branch -M main&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git commit -m "Add initial files from local"&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git push -u origin main&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Note that steps 2, 3, and 5 are verbatim from GitHub's recommendations. While my three "missing steps" may seem painfully obvious to any experienced developer, I wanted to highlight them for the more junior members among us.&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>repo</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Determine the Maximum Number</title>
      <dc:creator>Jackson Reeves</dc:creator>
      <pubDate>Mon, 22 Feb 2021 02:09:33 +0000</pubDate>
      <link>https://dev.to/jtreeves/determine-the-maximum-number-1che</link>
      <guid>https://dev.to/jtreeves/determine-the-maximum-number-1che</guid>
      <description>&lt;p&gt;I overshot the goal on a homework assignment and came up with a function that would handle edge cases. It was just supposed to take in three distinct numerical inputs and determine which one was the largest. But I built my function to account for the possibility that two or even all three of the numbers might be identical, plus the possibility that one or all of the inputs might be non-numerical. It may have been overkill, but I’m pretty proud of how much I nerded out here.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


</description>
      <category>number</category>
      <category>javascript</category>
      <category>maximum</category>
      <category>function</category>
    </item>
    <item>
      <title>Triple All the Numbers</title>
      <dc:creator>Jackson Reeves</dc:creator>
      <pubDate>Mon, 22 Feb 2021 02:05:20 +0000</pubDate>
      <link>https://dev.to/jtreeves/triple-all-the-numbers-4oko</link>
      <guid>https://dev.to/jtreeves/triple-all-the-numbers-4oko</guid>
      <description>&lt;p&gt;This function takes in an array and returns a new array containing each element from the first array after they were multiplied by three. Note the comments interspersed in the code. They act as guideposts, explaining each step of the code in pseudocode to make it easier for the non-coder to understand.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


</description>
      <category>number</category>
      <category>triple</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Find the Mode of Intervals</title>
      <dc:creator>Jackson Reeves</dc:creator>
      <pubDate>Mon, 22 Feb 2021 02:01:57 +0000</pubDate>
      <link>https://dev.to/jtreeves/find-the-mode-of-intervals-58n3</link>
      <guid>https://dev.to/jtreeves/find-the-mode-of-intervals-58n3</guid>
      <description>&lt;p&gt;A simple Python function for calculating the MQR, a nifty statistical measure of spread that I came up with one night.&lt;/p&gt;

&lt;p&gt;I was annoyed that every measure of central tendency had a corresponding measure of spread—except mode. Mean has standard deviation; median has interquartile range. But what about mode? So for the sake of parity, I made one up.&lt;/p&gt;

&lt;p&gt;I call it the Minimal Quintile Range (or MQR), which provides the length of the smallest interval that contains at least a fifth of the data in a set. In other words, the mode of intervals.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


</description>
      <category>python</category>
      <category>statistics</category>
      <category>mode</category>
      <category>spread</category>
    </item>
    <item>
      <title>Push Object to a Paired Array</title>
      <dc:creator>Jackson Reeves</dc:creator>
      <pubDate>Mon, 22 Feb 2021 01:49:54 +0000</pubDate>
      <link>https://dev.to/jtreeves/push-object-to-a-paired-array-1837</link>
      <guid>https://dev.to/jtreeves/push-object-to-a-paired-array-1837</guid>
      <description>&lt;p&gt;Pushing an object from one array into another array’s object is tricky, especially if you don’t know how many elements are in each array or where each one might be found. If both objects in question happen to share a common key-value pair, then you can use this approach. You’ll end up giving the main array’s object a new key and setting its value to the other array’s object. You can achieve all of that with two &lt;code&gt;for&lt;/code&gt; loops that iterate over both arrays separately plus an &lt;code&gt;if&lt;/code&gt; conditional.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;For more details about this technique (and alternative solutions to its underlying problem), check out &lt;a href="https://stackoverflow.com/questions/39841513/how-to-combine-two-array-objects-if-a-key-value-matches-in-both-arrays"&gt;this Stack Overflow answer&lt;/a&gt; that ultimately put me on the right track.&lt;/p&gt;

</description>
      <category>object</category>
      <category>array</category>
      <category>pair</category>
      <category>push</category>
    </item>
    <item>
      <title>API and Database Playing Together</title>
      <dc:creator>Jackson Reeves</dc:creator>
      <pubDate>Mon, 22 Feb 2021 01:36:21 +0000</pubDate>
      <link>https://dev.to/jtreeves/api-and-database-playing-together-2gon</link>
      <guid>https://dev.to/jtreeves/api-and-database-playing-together-2gon</guid>
      <description>&lt;p&gt;I was in Promises Hell for about three days until I finally came up with this code. The problem: I needed to query my local database, then use the result from that query to make an API call, then render the results of both the database query and the API call on an EJS views page. This did not go as smoothly as I would have liked. The main hurdle was that my original code required making multiple API calls before moving on to the render stage, which landed me in Promises Hell. My solution was to parse some info from my database query to create a single string that I could feed into my API call, so I only needed to make one call instead of multiple (potentially hundreds) of calls each time. Then I was able to neatly package it all up and send it to my &lt;code&gt;rated&lt;/code&gt; EJS views page. Oh, complicated routes, you certainly can be fun.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


</description>
      <category>api</category>
      <category>database</category>
      <category>promise</category>
    </item>
    <item>
      <title>Code Snippets with Gist</title>
      <dc:creator>Jackson Reeves</dc:creator>
      <pubDate>Mon, 22 Feb 2021 01:34:08 +0000</pubDate>
      <link>https://dev.to/jtreeves/code-snippets-with-gist-3n57</link>
      <guid>https://dev.to/jtreeves/code-snippets-with-gist-3n57</guid>
      <description>&lt;p&gt;&lt;a href="https://gist.github.com"&gt;Gist&lt;/a&gt; is a cool resource. It’s for sharing code snippets anywhere online. It’s great if you want to share a few lines of your code instead of every document ever in your GitHub repo.&lt;/p&gt;

&lt;p&gt;It’s related to GitHub, but in a really weird way. It’s a subsidiary or vertical of GitHub, so if you have a GitHub account (which we all do), then you automatically have a Gist account. Annoyingly, it’s difficult to access Gist from GitHub, but easy to access GitHub from Gist. To find your Gist from your GitHub, you need to click on your profile icon, then scroll down to “Your gists” in the dropdown menu. There’s no other place to find it. Additionally, compare your Gist profile and your GitHub profile: If you view &lt;a href="https://gist.github.com/jtreeves"&gt;your Gist profile&lt;/a&gt;, there’s a link to view &lt;a href="https://github.com/jtreeves"&gt;your GitHub profile&lt;/a&gt; right below your profile pic and intro text, but not the other way around. Why? I have no idea, but I feel like this is a kind of annoying flaw.&lt;/p&gt;

&lt;p&gt;Also annoyingly, albeit this time because of Slack: You can’t embed a Gist snippet inside a Slack post (instead of creating a code snippet in Slack), but you can include a link to &lt;a href="https://gist.github.com/jtreeves/accfc41a2a768dc16b18f51b6287fcca"&gt;your Gist snippet&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The major benefit of Gist code snippet’s over Slack’s code snippets is that you can use a Gist version &lt;em&gt;anywhere&lt;/em&gt;, whereas Slack’s versions can only be used on Slack.&lt;/p&gt;

</description>
      <category>gist</category>
      <category>github</category>
      <category>code</category>
      <category>snippet</category>
    </item>
    <item>
      <title>The Joys of Slack</title>
      <dc:creator>Jackson Reeves</dc:creator>
      <pubDate>Mon, 22 Feb 2021 01:31:54 +0000</pubDate>
      <link>https://dev.to/jtreeves/the-joys-of-slack-2hb5</link>
      <guid>https://dev.to/jtreeves/the-joys-of-slack-2hb5</guid>
      <description>&lt;p&gt;If you’re new to Slack and aren’t quite sure how to navigate all its functionalities, this guide might help! Included: tips on how to pep up your posts with different styles, a hands-holding guide to replying to a post in its thread as opposed to just in the general channel, and a note about emojis.&lt;/p&gt;

&lt;p&gt;POSTS&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  new line: &lt;code&gt;shift&lt;/code&gt; + &lt;code&gt;enter&lt;/code&gt; (without the &lt;code&gt;shift&lt;/code&gt;, it’ll post)&lt;/li&gt;
&lt;li&gt;  post: &lt;code&gt;enter&lt;/code&gt; (no &lt;code&gt;shift&lt;/code&gt; this time)&lt;/li&gt;
&lt;li&gt;  keywords: surround text with backticks (e.g., &lt;code&gt;keyword text&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;  bold: surround text with asterisks (e.g., &lt;em&gt;bolded text&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;  italicize: surround text with underscores (e.g., &lt;em&gt;italicized text&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;  lists: begin message with the numeral one ( 1 ) for ordered lists or an asterisk ( * ) for unordered lists&lt;/li&gt;
&lt;li&gt;  block quote: begin line with a bracket ( &amp;gt; ); get out of it by creating a new line&lt;/li&gt;
&lt;li&gt;  inline code: begin with triple backticks ( 

``&lt;code&gt;

); get out of it by closing it with triple backticks
*   code snippet: click &lt;/code&gt;lightning bolt&lt;code&gt; in new message, then select &lt;/code&gt;create a code or text snippet&lt;code&gt;, then select what language to use in the &lt;/code&gt;type` dropdown menu, then paste in the editor&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;THREADS&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  reply to a post by clicking the &lt;code&gt;chat bubble&lt;/code&gt; icon to go to the thread&lt;/li&gt;
&lt;li&gt;  post your comment as a reply in that specific thread, as opposed to in the general channel stream&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;REACTIONS&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  use emojis to quickly reply to a message without using text&lt;/li&gt;
&lt;li&gt;  have everyone click on a certain emoji to indicate they’ve completed a task&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;MENTIONS&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  grab someone’s attention by using the “at” symbol ( @ ) before their username&lt;/li&gt;
&lt;li&gt;  users get notifications of their mentions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;MESSAGES&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  send a private message to specific user by going to the &lt;code&gt;All DMs&lt;/code&gt; link in the top left of the main sidebar&lt;/li&gt;
&lt;li&gt;  type a user into the search bar to pull them up, then send them your message&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;CHANNELS&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  organize discussions into different sections, based on their primary focus&lt;/li&gt;
&lt;li&gt;  searchable&lt;/li&gt;
&lt;li&gt;  join or leave as needed&lt;/li&gt;
&lt;li&gt;  all your channels appear in your sidebar under &lt;code&gt;channels&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;  stars: star channels to pull them out of the general &lt;code&gt;channels&lt;/code&gt; section of the sidebar and into a new &lt;code&gt;starred&lt;/code&gt; section of the sidebar&lt;/li&gt;
&lt;li&gt;  pins: pin important messages in threads, so they’ll always be accessible via the &lt;code&gt;pin&lt;/code&gt; icon in the top left corner of a channel’s stream&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;INTEGRATIONS&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  you can link up third-party platforms like Dropbox or Google Calendar&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;MORE INFO:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://slack.com/resources/using-slack/how-to-use-slack"&gt;https://slack.com/resources/using-slack/how-to-use-slack&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://slack.com/help/articles/202288908-Format-your-messages"&gt;https://slack.com/help/articles/202288908-Format-your-messages&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://slack.com/help/articles/204145658-Create-a-snippet"&gt;https://slack.com/help/articles/204145658-Create-a-snippet&lt;/a&gt;&lt;/p&gt;

</description>
      <category>slack</category>
    </item>
    <item>
      <title>Naming Conventions</title>
      <dc:creator>Jackson Reeves</dc:creator>
      <pubDate>Mon, 22 Feb 2021 01:30:17 +0000</pubDate>
      <link>https://dev.to/jtreeves/naming-conventions-4nhm</link>
      <guid>https://dev.to/jtreeves/naming-conventions-4nhm</guid>
      <description>&lt;p&gt;Anytime you create something new, you should give it a name. But what to choose? And how should it look? In terms of &lt;em&gt;what&lt;/em&gt;, a good rule of thumb is descriptive but concise yet unique. In terms of &lt;em&gt;look&lt;/em&gt;, it all comes down to “case,” from which there are quite a few to choose. The only thing they share is a refusal to use a space with multi-word identifiers. But how to style the rest? Do you want to replace the spaces with underscores? Do you want to alternate uppercase and lowercase letters? The decision gets particularly tricky because different scenarios call for different cases. Here are the four most common types of cases (as applied to the string “my identifier”), along with their common names, alternative names, and when to use them—plus some of their important variants.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;myidentifier&lt;/strong&gt; : flat case (lazy case); Java packages&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  MYIDENTIFIER : screaming flat case (upper flat case); SQL&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;myIdentifier&lt;/strong&gt; : camel case (dromedary case, lower camel case); JavaScript&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  MyIdentifier : capital camel case (upper camel case, mixed case, medical case, Pascal case); Pascal, JavaScript classes, Python classes, Ruby classes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;my_identifier&lt;/strong&gt; : snake case (pothole case, underscore case); Python, Ruby, C&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  My_Identifier : capital snake case (camel snake case, mixed underscore case); Ada&lt;/li&gt;
&lt;li&gt;  MY_IDENTIFIER : screaming snake case (macro case, constant case); Python constants, Ruby constants, Java constants, C constants and macros&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;my-identifier&lt;/strong&gt; : kebab case (caterpillar case, spinal case, dash case); HTML, CSS, URL, Lisp&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  My-Identifier : capital kebab case (big caterpillar case); HTTP headers&lt;/li&gt;
&lt;li&gt;  MY-IDENTIFIER : screaming kebab case (train case); COBOL&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;MORE INFO:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Naming_convention_(programming)#Multiple-word_identifiers"&gt;https://en.wikipedia.org/wiki/Naming_convention_(programming)#Multiple-word_identifiers&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/17326185/what-are-the-different-kinds-of-cases"&gt;https://stackoverflow.com/questions/17326185/what-are-the-different-kinds-of-cases&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/60244301/where-does-the-word-pascal-case-come-from"&gt;https://stackoverflow.com/questions/60244301/where-does-the-word-pascal-case-come-from&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;FUN FACT:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Camel case was created in the 19th century by chemists, mostly for labeling elements in compounds. They capitalized the first letter of each chemical abbreviation and wrote chemical combinations without spaces between them (e.g., NaOH, NaCl). As a result, it was eventually known as "medical case.” In the 20th century, commercial companies adapted it for branding purposes (e.g., CinemaScope, VistaVision). In the 1970s, various computer programming languages adapted it as a naming convention for identifiers (e.g., WriteSymbol in Christopher Strachey’s GPM). In the 1990s, lower camel case became a popular trend with technology brands, which used “i” for internet or information and “e” for electronic (e.g., iMac, eBay). Around this time, calling the convention “medical case” was falling out of use, and some proposed alternatives were InterCaps and BiCapitalization. In 1995, Newton Love first used the term camel case, and it’s stuck ever since.&lt;/p&gt;

</description>
      <category>name</category>
      <category>convention</category>
    </item>
    <item>
      <title>How to Close an Entire Window</title>
      <dc:creator>Jackson Reeves</dc:creator>
      <pubDate>Sat, 20 Feb 2021 19:29:29 +0000</pubDate>
      <link>https://dev.to/jtreeves/how-to-close-an-entire-window-214h</link>
      <guid>https://dev.to/jtreeves/how-to-close-an-entire-window-214h</guid>
      <description>&lt;p&gt;If you want to close all the tabs open in one window of an application (aka, close a window), use &lt;code&gt;Shift-Command-W&lt;/code&gt;. (In contrast to using &lt;code&gt;Command-W&lt;/code&gt;, which only closes an individual tab open in one window of an application.) Just discovered this, and it’s a life-saver. Previously, I just quit VS Code after finishing each repo to avoid ending up with a cluttered screen.&lt;/p&gt;

</description>
      <category>window</category>
      <category>close</category>
      <category>tab</category>
      <category>quit</category>
    </item>
    <item>
      <title>Make iTerm Open Links in Chrome Instead of Safari</title>
      <dc:creator>Jackson Reeves</dc:creator>
      <pubDate>Sat, 20 Feb 2021 19:27:08 +0000</pubDate>
      <link>https://dev.to/jtreeves/make-iterm-open-links-in-chrome-instead-of-safari-3pcf</link>
      <guid>https://dev.to/jtreeves/make-iterm-open-links-in-chrome-instead-of-safari-3pcf</guid>
      <description>&lt;p&gt;Do you prefer to do all your development work in Chrome but still want to have Safari as your default browser? Sick of having iTerm automatically open all links in Safari instead of Chrome, and then having to copy said link and paste it into Chrome yourself? That takes up so many valuable seconds!&lt;/p&gt;

&lt;p&gt;Inspite of all my best research, I wasn’t able to find a way to configure this in iTerm’s preferences. Sure, there’s the Context Menu Items for Smart Selection Rule that’s mentioned in &lt;a href="https://stackoverflow.com/questions/46568358/how-do-i-configure-iterm2-to-open-urls-in-a-specific-browser"&gt;this Stack Overflow answer&lt;/a&gt;, but I wasn’t able to get that to do anything. Like, at all. But maybe I’m just stupid.&lt;/p&gt;

&lt;p&gt;Lacking an official approach, I did stumble across this hack: Add &lt;code&gt;BROWSER=chrome&lt;/code&gt; to your &lt;code&gt;.env&lt;/code&gt; file. Going forward, whenever you &lt;code&gt;npm start&lt;/code&gt;, it should open with Chrome (even if Safari, or whatever other app, is your default browser).&lt;/p&gt;

&lt;p&gt;A few caveats:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You have to do this individually with every repo going forward. But, on the plus side, once you do it initially with that repo, you should never need to worry about it opening in Chrome.&lt;/li&gt;
&lt;li&gt;React apps come with a lot of Node modules pre-installed. ENV is not one of them. You’ll need to &lt;code&gt;npm i dotenv&lt;/code&gt; after you &lt;code&gt;npx create-react-app&lt;/code&gt;. Then, of course, &lt;code&gt;touch .env&lt;/code&gt; once you’re in the repo’s main folder, so the file will be created at the top level. Interestingly, after merely creating the file and storing the above string in it, you don’t need to do anything else. As in, you don’t need to &lt;code&gt;require('dotenv').config()&lt;/code&gt; in your &lt;code&gt;index.js&lt;/code&gt; file or anywhere else (which I had to do with my other Node projects). If these additional steps sound unappealing, you could also just run this one, slightly longer line every time you plan to do an &lt;code&gt;npm start&lt;/code&gt;: just type &lt;code&gt;BROWSER=chrome npm start&lt;/code&gt;, which achieves the same effect as the above configuration.&lt;/li&gt;
&lt;li&gt;This approach wouldn’t work with any non-Node projects (React is Node compliant). So this wouldn’t work for any of vanilla JavaScript repos. Or anything in any other programming language. However, there may be some &lt;code&gt;.env&lt;/code&gt; analog in those situations. Plus, if you’re opening a file from the terminal, you can always type &lt;code&gt;open -a chrome index.html&lt;/code&gt; instead of &lt;code&gt;open index.html&lt;/code&gt; (or whatever file) in order to make it open in Chrome. Not as simple, but it works.&lt;/li&gt;
&lt;li&gt;Every OS handles this a little differently. Windows uses &lt;code&gt;chrome&lt;/code&gt;, Linux uses &lt;code&gt;google-chrome&lt;/code&gt;, and Mac uses &lt;code&gt;google chrome&lt;/code&gt;. So depending on your computer, you may need to type something different after &lt;code&gt;BROWSER=&lt;/code&gt; in your &lt;code&gt;.env&lt;/code&gt; file. (I have a Mac, but &lt;code&gt;chrome&lt;/code&gt; works for me; however, I think that’s because I renamed the Chrome app in my &lt;code&gt;Applications&lt;/code&gt; folder from &lt;code&gt;Google Chrome&lt;/code&gt; to just &lt;code&gt;Chrome&lt;/code&gt; forever ago. TLDR: Try them out until you get a fit, check what your Chrome app is specifically named in your &lt;code&gt;Applications&lt;/code&gt; folder if none of those are working, and try wrapping it in quotes if you need to use the two words &lt;code&gt;google chrome&lt;/code&gt;.)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;h/t to the &lt;a href="https://stackoverflow.com/questions/51706882/create-react-app-how-do-i-npm-start-with-a-specific-browser"&gt;Stack Overflow answer&lt;/a&gt; that finally led me to this approach&lt;/em&gt;&lt;/p&gt;

</description>
      <category>safari</category>
      <category>chrome</category>
      <category>iterm</category>
      <category>links</category>
    </item>
  </channel>
</rss>
