<?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: DylanC</title>
    <description>The latest articles on DEV Community by DylanC (@dclements9).</description>
    <link>https://dev.to/dclements9</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%2F108623%2F8a22c5f1-9ccc-4cc4-af06-e208de005d8a.jpg</url>
      <title>DEV Community: DylanC</title>
      <link>https://dev.to/dclements9</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dclements9"/>
    <language>en</language>
    <item>
      <title>Simple Calendar Functions</title>
      <dc:creator>DylanC</dc:creator>
      <pubDate>Thu, 30 Jan 2020 03:27:48 +0000</pubDate>
      <link>https://dev.to/dclements9/simple-calendar-functions-5ei5</link>
      <guid>https://dev.to/dclements9/simple-calendar-functions-5ei5</guid>
      <description>&lt;p&gt;I recently created a Search Bar to see the process of creation and how I could get it to work. It was a tremendous help in getting my head to wrap around the intricacies of creating and running such a thing.&lt;/p&gt;

&lt;p&gt;So when it came time to implement a few calendar features, I chose to do the same thing. I feel most comfortable implementing features and tools when I can understand what makes them truly work. Building the features/tools myself (when I have time) is my preferred method of accomplishing this goal.&lt;/p&gt;

&lt;p&gt;I had some experience creating minimal calendar functionality with Ruby on Rails before this. This post was my first time attempting these features with a ReactJS Frontend &amp;amp; Rails backend. After completing this task, I plan to test and implement a calendar library to see the differences, which I'll be writing about next week.&lt;/p&gt;

&lt;p&gt;The main functionalities I need are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Ability to create a lesson on a particular date. Preferably with a calendar date selector. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Have start and end times for each lesson. Preferably with an easy to use time selector. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Have both the date and times associated with the lesson object on the backend. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Last but not least, have all of these properties accessible for viewing and editing later. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  One
&lt;/h3&gt;

&lt;p&gt;With the help of &lt;a href="https://react-bootstrap.github.io/components/forms/" rel="noopener noreferrer"&gt;React Bootstrap Forms&lt;/a&gt;, the first goal was easy to achieve.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Group&lt;/span&gt; &lt;span class="na"&gt;as&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;Row&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;controlId&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"dateGroup"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Label&lt;/span&gt; &lt;span class="na"&gt;column&lt;/span&gt; &lt;span class="na"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Date:&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Col&lt;/span&gt; &lt;span class="na"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Control&lt;/span&gt; &lt;span class="na"&gt;required&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"date"&lt;/span&gt; &lt;span class="na"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"1"&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"date"&lt;/span&gt; &lt;span class="na"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;handleChange&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Col&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Group&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;h3&gt;
  
  
  Two
&lt;/h3&gt;

&lt;p&gt;After a bit of research into trying different options with date and time connected, I decided to separate the concerns. After discovering there was a 'date' type for form, I also discovered there's a time type.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Group&lt;/span&gt; &lt;span class="na"&gt;as&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;Row&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;controlId&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"timeGroup"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Label&lt;/span&gt; &lt;span class="na"&gt;column&lt;/span&gt; &lt;span class="na"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Start Time:&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
           &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Col&lt;/span&gt; &lt;span class="na"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
               &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Control&lt;/span&gt; &lt;span class="na"&gt;required&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"time"&lt;/span&gt; &lt;span class="na"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"1"&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"start_time"&lt;/span&gt; &lt;span class="na"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;handleChange&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
           &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Col&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Label&lt;/span&gt; &lt;span class="na"&gt;column&lt;/span&gt; &lt;span class="na"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;End Time:&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
           &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Col&lt;/span&gt; &lt;span class="na"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Control&lt;/span&gt; &lt;span class="na"&gt;required&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"time"&lt;/span&gt; &lt;span class="na"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"1"&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"end_time"&lt;/span&gt; &lt;span class="na"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;handleChange&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
           &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Col&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Group&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;While my original goal was to create and associate at the same time, this method is simplistic, even with dealing with the separation later.&lt;/p&gt;

&lt;h3&gt;
  
  
  Three
&lt;/h3&gt;

&lt;p&gt;This goal took slightly more work. Because of the separation of date and times, I would deal with them individually. This method ended up working out in the end, as it gave me more flexibility to manipulate and send data back and forth the way I wanted to. To start, Javascript and Ruby have different beliefs on the format a date should be by default. Ruby: &lt;code&gt;Mon, 01 Jan&lt;/code&gt; JS: &lt;code&gt;Wed Jan 01 2020 12:00:00 GMT-0500 (Eastern Standard Time)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In usual fashion, JS is trying hard to be overly helpful while Ruby keeps things simple. Depending on the use case, one can be more helpful than the other. But in this scenario, I needed a universal standard. In addition to the different language date formatting, when passed through a fetch request, like all things over the internet, it becomes a string. Because I prefer to keep objects as objects, especially when going from front to back end, I converted them each way to a standard. This function took care of formatting when displaying to the user: &lt;/p&gt;

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

&lt;p&gt;The start and end times had similar obstacles, which I dealt with similarly. The previous separation of date and times allowed for easier conversions. The counterpart to the previous formatDate function:&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Four
&lt;/h3&gt;

&lt;p&gt;The majority of my time went into this goal. Partly due to deciding to add new features as I went on. The last goal previewed viewing date and time. The editing became a mixture of the creation and viewing of a lesson.&lt;/p&gt;

&lt;p&gt;However, after making the create, view, and edit functionalities, I decided I wanted one more feature. In most calendar implementations, there's the ability to create recurring events. This goal was the most challenging and enjoyable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Five
&lt;/h3&gt;

&lt;p&gt;I started with what I knew. It needed a way for the user to select the frequency (Once, Weekly, Monthly): &lt;/p&gt;

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

&lt;p&gt;With my first attempt, I left it a once, one week, or one month. But I quickly decided I wasn't happy with having such limited options. So I added an amount for the frequency:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwuccvm840plecvkd399h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwuccvm840plecvkd399h.png" alt="Number format field to select frequency number"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This option allowed the user to select how many weeks or months.&lt;/p&gt;

&lt;p&gt;I used a simple switch statement to handle the user input:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;switch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;occurrence&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Weekly&lt;/span&gt;&lt;span class="dl"&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;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Monthly&lt;/span&gt;&lt;span class="dl"&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;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nl"&gt;default&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="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Default would handle the 'Once' option as it's the only option that did not require an additional choice. The fun part came next. Creating the algorithm to add weeks or months to the user input. After trial and error and some mixed results, this was the final weekly case statement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Weekly&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;this&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="nf"&gt;createLesson&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;this&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;history&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;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&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;dayDate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;occurrenceNumber&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;newDayDate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addDays&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dayDate&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="nx"&gt;dayDate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;newDayDate&lt;/span&gt;

        &lt;span class="k"&gt;this&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="nf"&gt;createLesson&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;this&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;history&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dayDate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&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.addDays() was the heavy-lifting function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;addDays&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;days&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;nextDate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
        &lt;span class="nx"&gt;nextDate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setDate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getDate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;days&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;nextDate&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Monthly was similar with addMonths adding 30 days to the date. Unfortunately, this simple implementation does not take into account over 30 day months or leap years. Something that given more time, I would like to change.&lt;/p&gt;

&lt;p&gt;The Default case had a simple one liner: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;this.props.createLesson(this.state, this.props.history)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After taking care of how to make the calculations. I needed to connect the changes to the Rails backend:&lt;/p&gt;

&lt;p&gt;The create lesson action:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;createLesson&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lesson&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;history&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;date&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;date&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;lesson&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toISOString&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;T&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&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;dispatch&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;fetch&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;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;
                &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&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;application/json&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;Accept&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;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;lesson&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="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lesson&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;dispatch&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;LESSON_CREATED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;lesson&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="nx"&gt;history&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`/lessons`&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="p"&gt;};&lt;/span&gt;
&lt;span class="s2"&gt;```



I won't go into too much detail as most of it's a standard asynchronous fetch request between JS and Rails. A couple of key points; The `&lt;/span&gt;&lt;span class="nx"&gt;history&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; commands are there to redirect the page after creating/editing. 

The `if (date) {lesson.date = date.toISOString().split("T")[0]}` was added after creating this goal. It takes into consideration that if the date is undefined because the frequency is &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;Once&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;, the request won&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;t&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&gt;However&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nx"&gt;there&lt;/span&gt; &lt;span class="nx"&gt;is&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;date&lt;/span&gt; &lt;span class="nx"&gt;argument&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;it&lt;/span&gt; &lt;span class="nx"&gt;converts&lt;/span&gt; &lt;span class="nx"&gt;into&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;universal&lt;/span&gt; &lt;span class="nx"&gt;format&lt;/span&gt; &lt;span class="nx"&gt;I&lt;/span&gt; &lt;span class="nx"&gt;chose&lt;/span&gt; &lt;span class="nx"&gt;before&lt;/span&gt; &lt;span class="nx"&gt;sending&lt;/span&gt; &lt;span class="nx"&gt;it&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;Rails&lt;/span&gt; &lt;span class="nx"&gt;side&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;

&lt;span class="err"&gt;###&lt;/span&gt; &lt;span class="nx"&gt;Conclusion&lt;/span&gt; 

&lt;span class="nx"&gt;Coming&lt;/span&gt; &lt;span class="nx"&gt;up&lt;/span&gt; &lt;span class="kd"&gt;with&lt;/span&gt; &lt;span class="nx"&gt;elementary&lt;/span&gt; &lt;span class="nx"&gt;solutions&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;solved&lt;/span&gt; &lt;span class="nx"&gt;solutions&lt;/span&gt; &lt;span class="nx"&gt;isn&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;t always possible with time and resources. But I find it incredibly rewarding, educational, and the best way to understand what I&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;m&lt;/span&gt; &lt;span class="nx"&gt;asking&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&gt;Reinventing&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;wheel&lt;/span&gt; &lt;span class="nx"&gt;every&lt;/span&gt; &lt;span class="nx"&gt;time&lt;/span&gt; &lt;span class="nx"&gt;doesn&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;t make sense, understanding how the wheel works to manipulate it down the road better, absolutely makes sense to me. For my post next week, I&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;ll&lt;/span&gt; &lt;span class="nx"&gt;take&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;look&lt;/span&gt; &lt;span class="nx"&gt;at&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;different&lt;/span&gt; &lt;span class="nx"&gt;calendar&lt;/span&gt; &lt;span class="nx"&gt;library&lt;/span&gt; &lt;span class="nx"&gt;solutions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;how&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;implement&lt;/span&gt; &lt;span class="nx"&gt;them&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;and&lt;/span&gt; &lt;span class="nx"&gt;how&lt;/span&gt; &lt;span class="nx"&gt;they&lt;/span&gt; &lt;span class="nx"&gt;differ&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="nx"&gt;my&lt;/span&gt; &lt;span class="nx"&gt;simple&lt;/span&gt; &lt;span class="nx"&gt;solution&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;



&lt;span class="err"&gt;###&lt;/span&gt; &lt;span class="nx"&gt;Attribution&lt;/span&gt;
&lt;span class="nx"&gt;Cover&lt;/span&gt; &lt;span class="nx"&gt;Photo&lt;/span&gt; &lt;span class="nx"&gt;by&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;Roman&lt;/span&gt; &lt;span class="nx"&gt;Bozhko&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="nx"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//unsplash.com/@romanbozhko?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText) on [Unsplash](https://unsplash.com/?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>beginners</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Quick React Bootstrap NavBar</title>
      <dc:creator>DylanC</dc:creator>
      <pubDate>Thu, 23 Jan 2020 02:15:36 +0000</pubDate>
      <link>https://dev.to/dclements9/quick-react-bootstrap-navbar-16gc</link>
      <guid>https://dev.to/dclements9/quick-react-bootstrap-navbar-16gc</guid>
      <description>&lt;p&gt;React-bootstrap's documentation is incredibly helpful. Probably some of the best I've come across. However, as a newbie, getting to the point of implementation and testing can seem a little confusing at times. If you'd prefer to read the technical side without the introduction, skip to 'The Bar' section.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Need
&lt;/h3&gt;

&lt;p&gt;My experience with designing user interfaces is quite small. Before &lt;a href="https://flatironschool.com/"&gt;The Flatiron School&lt;/a&gt;, at my job at an IT consulting firm, I created terminal/command prompt tools for mostly automation or limited user/technician interaction. While you can thoughtfully place prompts, colors (which quickly become too much.), and information, there aren't many options to make it a more desirable interaction.&lt;/p&gt;

&lt;p&gt;In my previous projects, I dabbled with a bit of CSS. Putting bits of code together to make something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wTsmhwi---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/decf05i5kemb733znpf5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wTsmhwi---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/decf05i5kemb733znpf5.png" alt="" width="880" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And others to create more reactive star ratings like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gvnrTKmp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/fpqf8mytvxip55n9tjen.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gvnrTKmp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/fpqf8mytvxip55n9tjen.gif" alt="" width="640" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My next attempt was using the &lt;a href="https://getbootstrap.com/"&gt;Bootstrap&lt;/a&gt; gem to create a navbar:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bIO9logm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7itgfaemkwtfnbauncly.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bIO9logm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7itgfaemkwtfnbauncly.gif" alt="" width="880" height="471"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It was simple and served it's purpose entirely at the time.&lt;/p&gt;

&lt;p&gt;For the latest attempt, I wanted a navbar that felt a little more fluid and enjoyable, especially since a user has to stare at it throughout the app. After trying other components with &lt;a href="https://react-bootstrap.github.io/"&gt;React-Bootstrap&lt;/a&gt;, it was an easy decision to give their styled navbar a try. Once implemented, following the documentation to fulfill your needs is rather simple. There are a plethora of options you can test and use to make a professional and attractive Navbar. So, on to the good part, how I quickly implemented it.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Bar
&lt;/h3&gt;

&lt;p&gt;The Navbar component itself is simple and pretty much covered on the &lt;a href="https://react-bootstrap.github.io/components/navbar/"&gt;Navbar documentation&lt;/a&gt;. Here's the code I used for interest and reference:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&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;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;connect&lt;/span&gt; &lt;span class="p"&gt;}&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;react-redux&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Navbar&lt;/span&gt; &lt;span class="p"&gt;}&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;react-bootstrap&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;NavDropdown&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;react-bootstrap/NavDropdown&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;NavBar&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="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Navbar&lt;/span&gt; &lt;span class="na"&gt;bg&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"black"&lt;/span&gt; &lt;span class="na"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"dark"&lt;/span&gt; &lt;span class="na"&gt;sticky&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"top"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Navbar&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Brand&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;img&lt;/span&gt;
        &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"./logo.png"&lt;/span&gt;
        &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"30"&lt;/span&gt;
        &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"30"&lt;/span&gt;
        &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"d-inline-block align-top"&lt;/span&gt;
        &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;" "&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;img&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Navbar&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Brand&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;NavDropdown&lt;/span&gt; &lt;span class="na"&gt;bg&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"black"&lt;/span&gt; &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Menu"&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"collasible-nav-dropdown"&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#5299d3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;NavDropdown&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Item&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#5299d3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Home&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;NavDropdown&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Item&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;NavDropdown&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Item&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#5299d3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"/welcome"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Admin&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;NavDropdown&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Item&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;NavDropdown&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Item&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#5299d3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"/users"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Users&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;NavDropdown&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Item&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;NavDropdown&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Item&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#5299d3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"/lessons"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Lessons&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;NavDropdown&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Item&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;NavDropdown&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Item&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#5299d3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"/challenges"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Challenges&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;NavDropdown&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Item&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;NavDropdown&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;    
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Navbar&lt;/span&gt;&lt;span class="p"&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;export default connect()(NavBar);&lt;/p&gt;

&lt;p&gt;To import the component, it's as you would expect in a React app: &lt;code&gt;import NavBar from './components/Navbar';&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Which I included in the &lt;code&gt;App.js&lt;/code&gt; component, which is where I also implemented react-router-dom to route the component pages: &lt;code&gt;import { BrowserRouter as Router, Route} from 'react-router-dom'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Integrating the navbar into the rest of the components threw me off a bit. Ultimately I found the simplest was also the best solution (Other routes replaced with '...' for presentation purposes): &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FqrW7daH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/z0wife6j2u3q6owzmi3n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FqrW7daH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/z0wife6j2u3q6owzmi3n.png" alt="" width="790" height="874"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;With this navbar version, I was able to add a simple logo, dropdown menu, and the app's universal font I previously chose. While I decided to have the navbar remain at the top as the user scrolls, the transparency keeps the fluid aesthetic across the app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Attribution
&lt;/h3&gt;

&lt;p&gt;Cover Photo by &lt;a href="https://unsplash.com/@alex_andrews?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Alexander Andrews&lt;/a&gt; on &lt;a href="https://unsplash.com/?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>The Great Search [bar] - Part 2 - Deep Dive</title>
      <dc:creator>DylanC</dc:creator>
      <pubDate>Wed, 15 Jan 2020 18:48:08 +0000</pubDate>
      <link>https://dev.to/dclements9/the-great-search-bar-part-2-deep-dive-1mpm</link>
      <guid>https://dev.to/dclements9/the-great-search-bar-part-2-deep-dive-1mpm</guid>
      <description>&lt;p&gt;Part one was more about the overview of why I bothered to create my search bar instead of copying other code. This time, I’ll focus on the technical or how and why I implemented it. &lt;/p&gt;

&lt;h3&gt;
  
  
  Retrieval
&lt;/h3&gt;

&lt;p&gt;Before I even started with the search bar, I needed to ensure the component wouldn’t break if the users’ list took a bit longer to fetch. Slower networks may not respond in a desirable amount of time. After beginning the fetch request for the list, I used a simple ‘if’ statement with a more user-friendly react-bootstrap spinner component, if the fetch was still completing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jprvP-rV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/947x7zeap52x9o502ii4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jprvP-rV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/947x7zeap52x9o502ii4.png" alt="" width="880" height="503"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Display
&lt;/h3&gt;

&lt;p&gt;After retrieving the current lesson for the user. The search bar needs to render and connect to the component state for later use.&lt;/p&gt;

&lt;p&gt;I used a simple form to display the bar, with a bit of react-bootstrap for styling and positioning. &lt;br&gt;
 &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UPeKJ8aX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7qg172ji8on10w65bdw3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UPeKJ8aX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7qg172ji8on10w65bdw3.png" alt="" width="880" height="538"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the state holding the search term, or last name:&lt;br&gt;
 &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jpYHGomj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/butfl592uk8e329f5h6v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jpYHGomj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/butfl592uk8e329f5h6v.png" alt="" width="880" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While the state updates with every keystroke by the user:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--epcc6vHv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/zxbmrpx3g25lhppgai1v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--epcc6vHv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/zxbmrpx3g25lhppgai1v.png" alt="" width="880" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first iteration of the search bar required the last name to be input and submitted before the search began. As the form is submitted, it invokes the function ‘handleSubmit’:&lt;br&gt;
 &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sIoDfjkb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/rp9ee9zdo9srynwmgvx1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sIoDfjkb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/rp9ee9zdo9srynwmgvx1.png" alt="" width="880" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once I had completed the search bar functionality, I found it very cumbersome and not as intuitive for the user as I would have liked. Whenever I do create something that requires user interaction, I prefer it to feel effortless and, if possible, familiar. So I added a function that we’ll see later on in another component which rendering invokes. With this, the search would perform with each input change. Thus, giving the user faster and distinct confirmation of the search functioning.&lt;/p&gt;

&lt;p&gt;Then the important step. Rendering the results and giving the option to check-in. I felt this was a good point to separate the concerns of rendering the interface and the actual searching. We’ll get back to why &lt;code&gt;this.props.history&lt;/code&gt; passes to &lt;code&gt;&amp;lt;SearchResults/&amp;gt;&lt;/code&gt;&lt;br&gt;
 &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nPDfGeSp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/6vbwxj2r16f6wra8ob5b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nPDfGeSp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/6vbwxj2r16f6wra8ob5b.png" alt="" width="878" height="504"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Search
&lt;/h3&gt;

&lt;p&gt;Before I built the search bar, I rendered another component,&lt;code&gt;&amp;lt;RetrieveCurrentLesson/&amp;gt;&lt;/code&gt;, which (you guessed it) renders the current lesson. Understanding how it functions isn’t as important as it’s output. If there were no lessons for the day, it would display ‘No lessons today.’ Otherwise, the current lesson would display with start &amp;amp; end times. The code responsible for this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ldd834eZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/xascryof92dkz7q08euc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ldd834eZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/xascryof92dkz7q08euc.png" alt="" width="880" height="881"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I chose this way for a few reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It showed the user there were ‘No Lessons’ instead of blank or undefined.&lt;/li&gt;
&lt;li&gt;I thought there would be more confusion if I chose the next lesson to display even if it wasn’t for that day. Even though theoretically, there should be no students if there are no classes. I was building for a less specific and more scaled use. &lt;/li&gt;
&lt;li&gt;I could leverage the response of ‘No Lessons’ for the next component.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If there were no lessons for the day, I had to ensure that not only was it stated, but there was also no way to check-in by accident. So, as the component renders, it invokes a simple function to determine whether the check-in button should be enabled or not.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ldQv_iqF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/jroyjul1umca7oqxd7h6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ldQv_iqF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/jroyjul1umca7oqxd7h6.png" alt="" width="880" height="535"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After handling the no lesson errors, the search functionality comes next. When the component renders, it invokes &lt;code&gt;this.filterUsers(this.props)&lt;/code&gt; and maps over the output to display the user that matches the search term. The function itself filters the user list and compares the last name to the search term.&lt;/p&gt;

&lt;p&gt;With the selected user now being displayed with first name, last name, and rank. The button to check-in and attach the user displays with the following code &lt;code&gt;&amp;lt;Button variant="success" disabled={!isEnabled} onClick={() =&amp;gt; this.attachUser(user)}&amp;gt; Check-In &amp;lt;/Button&amp;gt;&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AS4CtwXD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/8yi4o3ai8pub6jeinaxt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AS4CtwXD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/8yi4o3ai8pub6jeinaxt.png" alt="" width="880" height="390"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Association
&lt;/h3&gt;

&lt;p&gt;When the button is enabled and clicked, it invokes the &lt;code&gt;attachUser&lt;/code&gt; function and passes the user as an argument. attachUser has a few responsibilities.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C_K-f6Xr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ndotz1peooltul5qk65y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C_K-f6Xr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ndotz1peooltul5qk65y.png" alt="" width="880" height="715"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First, it grabs the currentLesson from the redux store or props. It can then add the user to the list of users associated with the lesson and invoke the associateUser action, made available through redux &lt;code&gt;export default connect(state =&amp;gt; ({ currentLesson: state.currentLesson }), {associateUser})(SearchResults)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;As you can see, associateUser is a pretty standard fetch asynchronous request. It updates the provided lesson and expects the updated lesson back as the payload. I also added the history prop we previously passed down, which allows me to use this: &lt;code&gt;window.location.reload(false)&lt;/code&gt;. It reloads the page, leaving it ready for the next user to check in with a cleared search bar. The 'false' argument tells &lt;code&gt;window.location.reload&lt;/code&gt; to reload from cache if possible. Reloading with cache is faster and won’t affect the search bar functionality.&lt;/p&gt;
&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;I enjoyed going through each step and having to research every option to decide what was best for my situation.&lt;/p&gt;

&lt;p&gt;In the future, I’d like to experiment with large data sets to see if the constant rendering of components due to user input change, makes a performance difference. With the small data set I used and the overall better user experience, I preferred this way. &lt;/p&gt;

&lt;p&gt;If you have any questions or comments on how I can improve this, let me know! I’m a &lt;del&gt;junior&lt;/del&gt; developer, I’m always learning and improving.&lt;/p&gt;
&lt;h3&gt;
  
  
  Code Repo
&lt;/h3&gt;

&lt;p&gt;If you'd like to check out more of the code or suggest improvements. Here's the repo:&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/dclements9"&gt;
        dclements9
      &lt;/a&gt; / &lt;a href="https://github.com/dclements9/Hara-Frontend"&gt;
        Hara-Frontend
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Martial Arts Studio Management System (Frontend)
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;h3&gt;
  
  
  Attribution
&lt;/h3&gt;

&lt;p&gt;Cover Photo by &lt;a href="https://unsplash.com/@aridley88?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Andrew Ridley&lt;/a&gt; on &lt;a href="https://unsplash.com/?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>The Great Search [bar]- Part 1 - Context</title>
      <dc:creator>DylanC</dc:creator>
      <pubDate>Thu, 09 Jan 2020 03:14:45 +0000</pubDate>
      <link>https://dev.to/dclements9/the-great-search-part-1-context-24gd</link>
      <guid>https://dev.to/dclements9/the-great-search-part-1-context-24gd</guid>
      <description>&lt;p&gt;&lt;em&gt;I’m new to writing blog posts. So I’m trying something out. I’m splitting the more technically detailed portion from the less technically. Feel free to let me know if it feels silly to be separated or keeps it more coherent. Part 2 - Deep Dive coming soon.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;While a simple Google search reveals many ways to create a Search Bar with &lt;strong&gt;React &amp;amp; Javascript&lt;/strong&gt;, I wanted to create my own to understand how it works. If you’d like to skip the extended version, head to &lt;strong&gt;'The Implementation’&lt;/strong&gt; section or check out the technically detailed post coming on Tuesday. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Project
&lt;/h2&gt;

&lt;p&gt;My most recent project was creating a React client for a Rails API. I created an uncomplicated martial arts studio management system. The administrator can create users/students, lessons/classes, and student challenges. While the student side would be able to sign in when they attend class.&lt;/p&gt;

&lt;p&gt;For the student sign-in, I planned to implement a clean and intuitive search bar. The student would type their last name, and their information would populate with the option to check-in. Keeping it simple, easy, and to the point was my main focus. Unfortunately, I had no idea where to start. Like my time with The Flatiron School had taught me, I started with what I knew:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The search bar had to be able to fetch all the users&lt;/li&gt;
&lt;li&gt;After retrieving the users, it would have to filter the users&lt;/li&gt;
&lt;li&gt;It would then need to display the user’s information clearly for the user to read.&lt;/li&gt;
&lt;li&gt;It would also need to display a functional button to check the user in&lt;/li&gt;
&lt;li&gt;The current lesson would need to be retrieved to be attached to the selected user.&lt;/li&gt;
&lt;li&gt;Ideally: It would be able to do this all while the user was still typing&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Knowledge
&lt;/h2&gt;

&lt;p&gt;All of this felt reasonable to achieve, and while I wrote the pseudo-code, it started to come together. I knew how it &lt;em&gt;should&lt;/em&gt; function, but I was hazy on how the implementation. So as any developer does when confronted with a lack of knowledge, I went to Google. Unsurprisingly, there are many methods people use to implement a search bar.&lt;/p&gt;

&lt;p&gt;While I read through the various techniques, I could understand the processes, but I couldn’t understand the reasons for their designs or why I would prefer one over the other. I didn’t feel comfortable using code I couldn’t fully explain the reason behind using. So I decided to create my own.&lt;br&gt;
 &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PSgWZFxY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1558420034-e98aa2ce8cac%3Fixlib%3Drb-1.2.1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PSgWZFxY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1558420034-e98aa2ce8cac%3Fixlib%3Drb-1.2.1" alt="" width="880" height="642"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;h3&gt;
  
  
  First Step - Search Bar
&lt;/h3&gt;

&lt;p&gt;The search bar renders a form for user input assigned to the searchTerm state.&lt;/p&gt;

&lt;h3&gt;
  
  
  Second Step - Current Lesson
&lt;/h3&gt;

&lt;p&gt;On the initial render of the home page component,  &lt;code&gt;&amp;lt;RetrieveCurrentLesson /&amp;gt;&lt;/code&gt; retrieves the current lesson. Once mounted, the component fetches all lessons. It then filters the lessons by date &amp;amp; time to find the nearest lesson to the current date &amp;amp; time. Afterwards, &lt;code&gt;&amp;lt;DisplayCurrentLesson lesson={nextLesson} /&amp;gt;&lt;/code&gt; is called to handle displaying the contents.&lt;/p&gt;

&lt;h3&gt;
  
  
  Third Step - State
&lt;/h3&gt;

&lt;p&gt;As the user input changes (the user enters or removes a character), the searchTerm state is updated:&lt;br&gt;
 &lt;code&gt;handleChange = (e) =&amp;gt; { this.setState({ [e.target.name]: e.target.value })}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This state is then passed to another component: &lt;code&gt;&amp;lt;SearchResults searchTerm={this.state.searchTerm} /&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Fourth Step - Search
&lt;/h3&gt;

&lt;p&gt;The users list passes to the SearchResults component after being fetched from the home page component. Much like the current lesson, the user is then filtered based on the searchTerm state from User input.&lt;/p&gt;

&lt;p&gt;As a user’s last name matches a user in the users list, it is displayed along with a button to ‘Check-in’.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fifth Step - Association
&lt;/h3&gt;

&lt;p&gt;The button rendered with the searched user associates the user with the current lesson. The home page then renders a cleared form, ready for the next user to ‘Check-In’.&lt;/p&gt;

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

&lt;p&gt;As they say, “There’s more than one way to skin a cat.” Ultimately, I’m glad I went through the trouble of creating my method. It forced me to understand the workflow and design. Even if it’s not the most efficient method, I’m proud of it and can always improve. &lt;/p&gt;

&lt;h3&gt;
  
  
  Attribution
&lt;/h3&gt;

&lt;p&gt;Cover Photo by &lt;a href="https://unsplash.com/@andrewtneel?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Andrew Neel&lt;/a&gt; on &lt;a href="https://unsplash.com/?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Second Photo by &lt;a href="https://unsplash.com/@evgenit?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Evgeni Tcherkasski&lt;/a&gt; on &lt;a href="https://unsplash.com/?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>The Flatiron Experience</title>
      <dc:creator>DylanC</dc:creator>
      <pubDate>Mon, 06 Jan 2020 21:45:42 +0000</pubDate>
      <link>https://dev.to/dclements9/the-flatiron-experience-1dgh</link>
      <guid>https://dev.to/dclements9/the-flatiron-experience-1dgh</guid>
      <description>&lt;p&gt;I originally posted this on my Flatiron blog on November 29, 2019. But I wanted to share my experience with others. So here it is:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n0tvLVnC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1522202176988-66273c2fd55f%3Fixlib%3Drb-1.2.1%26ixid%3DeyJhcHBfaWQiOjEyMDd9" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n0tvLVnC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1522202176988-66273c2fd55f%3Fixlib%3Drb-1.2.1%26ixid%3DeyJhcHBfaWQiOjEyMDd9" alt="" width="880" height="587"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;373 days,&lt;/strong&gt; that’s how long it’s been since I was accepted to The Flatiron School and began my life long journey of learning to code. At the time, I understood it would change my life, but I didn’t truly understand the magnitude of change. But before I get to my experience of the past year, a little backstory/introduction. &lt;/p&gt;

&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;I discovered coding first in college after spending a couple of years searching for what I wanted to pursue. I fell in love with code and graduated with an Associates in Computer Science. After graduating, I found an internship at an IT consulting firm, which unfortunately didn’t involve much coding. Long story short, life has a way of changing our plans, and I ended up spending 7 1/2 years there. &lt;/p&gt;

&lt;p&gt;Two kids and a few gray hairs later, I found myself missing coding more than ever. I fell in love with the whole process: creating and debugging code, diving deep to find the real “bug”, and even that headbanging feeling when you just can’t figure out what’s going wrong. Enter &lt;strong&gt;‘The Flatiron School’&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Search
&lt;/h3&gt;

&lt;p&gt;I spent a couple of months researching different boot camps. The on-campus boot camps were either too far away or a bit too late to make it to every week, so I focused on online programs. As I narrowed it down further and further, it began to feel a little like pulling a random name out of a hat. They all seemed terrific, graduates were happy for the most part, and employment rates were relatively high. Ultimately, it was The Flatiron School that won out for me. But it wasn’t until I thought about what I wanted to get out of a program and what I enjoyed doing, that I decided.&lt;/p&gt;

&lt;p&gt;The Flatiron School is big on community and support. Of course, every school says the same thing about the importance of both. But Flatiron talks the talk &lt;em&gt;and&lt;/em&gt; walks the walk. They not only give you a support group in the form of an educational coach, cohort lead, and a cohort of like-minded learners; they also teach you how to make your own community going forward. Sounds too good to be true, right? Exactly what I thought as I decided to take the plunge. Happily, I discovered it is quite real.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Coach
&lt;/h3&gt;

&lt;p&gt;With all the forms of support intertwined, it’s difficult knowing where to start. So let’s begin with the educational coach, the person I didn’t realize I would need as much assistance from as I did. She introduced herself by explaining the difference between an educational coach and a therapist. On your journey, there will be ‘potholes’, an educational coach will help you navigate around them and get you back on the path, while a therapist will stop for a while and help you dive right into the hole. Turns out, when you’re on an accelerated learning path of dealing with complex ideas, this is &lt;em&gt;incredibly&lt;/em&gt; useful and precisely what you need. &lt;/p&gt;

&lt;p&gt;About halfway through the program, I was finishing up with my second project and decided to venture out to the local tech/coding group meetup. I was &lt;em&gt;terrified&lt;/em&gt;. I consider myself a social introvert. I love interacting and working with people, but a roomful of strangers is a little daunting. My coach told me exactly what I needed to hear. Not just the usual ‘You’ll be fine. Push through it. You’re worth it!’ Sort of thing. She gave me specific, actionable advice. She taught me how to manage my anxiety, get my feet wet without throwing myself in the ocean, and how to push past my comfort zone while remaining calm. After I successfully survived the meetup, it was much easier when it came to Codeland 2019 and a couple of other conferences this past year.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zVRVVB9v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1568992688065-536aad8a12f6%3Fixlib%3Drb-1.2.1%26ixid%3DeyJhcHBfaWQiOjEyMDd9" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zVRVVB9v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1568992688065-536aad8a12f6%3Fixlib%3Drb-1.2.1%26ixid%3DeyJhcHBfaWQiOjEyMDd9" alt="" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Comrades in Arms
&lt;/h3&gt;

&lt;p&gt;Which brings me to the next part of community and support, your classmates. During the Flatiron program, it can feel very intense and overwhelming. While having loved ones to support and assist you through all of this is imperative; no-one understands quite like other Flatironers. My cohort quickly became an immense help in not only the technical support side of things, but making me feel like I wasn’t alone in all of the stress, worry, and of course the dreaded imposter syndrome (Which knocked me down a few times). They’re always there to lend a helping hand when they can, or to remind us all that we’re still very much students and don’t know everything! &lt;/p&gt;

&lt;p&gt;So when &lt;a href="https://codelandconf.com/"&gt;Codeland Conf 2019&lt;/a&gt; time came around (Which by the way is one of the most amazing experiences, even if you’re not a beginner), I took the plunge into the great unknown of going to a conference by myself &lt;strong&gt;gasp&lt;/strong&gt; . I ended up having the time of my coding life! I met up with other Flatiron students, both past and present. We all seem to unspeakably understand one another’s trials and found a little piece of ourselves in each other. Even after the conference, they were (and are) one of the essential points of coding community and support. &lt;/p&gt;

&lt;h3&gt;
  
  
  The Lead
&lt;/h3&gt;

&lt;p&gt;My last major point of community and support was anything but the least. Every cohort is given a cohort lead, which is a little bit deceiving of a title; at least I thought it was. I thought they would be strictly leading the way by lessons, giving pointers here and there. But she was so much more. Flatiron has spent a significant amount of time on both their program material and fostering supportive cohort leads.  &lt;/p&gt;

&lt;p&gt;Our lead taught us not only extra bits of material each week, she also taught us how to learn, how to dig into the problem and find the solution, how to push through failure, how to believe in ourselves without second-guessing (this one was big for me), and how to enjoy the process without becoming overwhelmed. She was very subtle about it all too. I slowly found myself internalizing all her lessons beyond the technical aspect and found myself becoming a better problem solver, which in turn made me a better coder and code partner. She especially had a talent for asking the right question to make you work your way to the answer, not give you the answer, even in the most ‘stuck’ situations. She’s a big reason I didn’t throw my code out and give up. Instead, she empowered me to keep moving and give my best’ till the end. &lt;/p&gt;

&lt;h3&gt;
  
  
  The Point
&lt;/h3&gt;

&lt;p&gt;I can easily make blog posts for each point I spoke about, and I’m sure other boot camps have similar aspects. But I can only speak of my experience. I feel like I made the right choice in the end and didn’t regret a moment of it. Flatiron is so much more than a school or boot camp, it’s a family. This family takes care of each other; whether they’re separated by years or countries, they’re always there for each other when they can be. &lt;/p&gt;

&lt;p&gt;To me, &lt;em&gt;that&lt;/em&gt; is what made this experience truly special, successful, and well worth every ounce of blood, sweat, and tears I gave to it. I’m going to miss every single person who has changed my life so drastically this past year. I can’t thank everyone enough. They have all contributed to the mindset I now have of breaking problems apart, starting with what I know, and solving the problem step by step. Career coaching (via the Flatiron program) and job hunting here I come!&lt;/p&gt;

&lt;h3&gt;
  
  
  Attribution
&lt;/h3&gt;

&lt;p&gt;Cover Photo by &lt;a href="https://unsplash.com/@miinyuii?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Duy Pham&lt;/a&gt; on &lt;a href="https://unsplash.com/?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First Photo by &lt;a href="https://unsplash.com/@brookecagle?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Banter Snaps&lt;/a&gt; on &lt;a href="https://unsplash.com/?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Second Photo by &lt;a href="https://unsplash.com/@bantersnaps?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Banter Snaps&lt;/a&gt; on &lt;a href="https://unsplash.com/?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Practice Makes Perfect</title>
      <dc:creator>DylanC</dc:creator>
      <pubDate>Thu, 09 May 2019 04:50:04 +0000</pubDate>
      <link>https://dev.to/dclements9/practice-makes-perfect-1</link>
      <guid>https://dev.to/dclements9/practice-makes-perfect-1</guid>
      <description>&lt;p&gt;Six weeks go by quickly, especially when you’re learning a skill that plunges you ever deeper into an endless world of excitement. Looking back, I can hardly believe I’ve learned as much as I have.&lt;/p&gt;

&lt;p&gt;I started my CLI project about two weeks ago, thinking I knew what I needed to complete it. But I wanted to solidify that knowledge. Practice makes perfect. But creative practice fills in the gaps you didn’t know were there.&lt;/p&gt;

&lt;p&gt;The project needed to scrape a website, provide the user with information, and have a command-line interface to interact with the program. I chose to scrape an event schedule to create an agenda for the user (&lt;a href="https://devfest.gdgcapitalregion.com/"&gt;GDG DevFest 2018&lt;/a&gt;). While properly learning to iterate through, filter, and attach my scraped results to an object, my best friend was Pry.&lt;/p&gt;

&lt;p&gt;I could go on and on about my love for Pry. But I’ll try to share a few of my favorite commands of Pry instead. While the most fundamental benefit of Pry is to essentially ‘pry’ open code, there is so much more to it. &lt;/p&gt;

&lt;p&gt;If you’re familiar with the terminal on a Unix system, you’ve probably used the ‘ls’ command to list files and folders. Pry has something similar. The ‘ls’ command will show you a list of possible methods and variables for the location you pried open. While this may seem like a trivial command by itself, when combined with other commands, it becomes mighty.&lt;/p&gt;

&lt;p&gt;Which brings me to my next command, ‘play’. More specifically, ‘play -l’ will play the line specified next. This command also provides a relatively easy way to step into or around blocks and iterations. When it’s combined with ‘ls’, you can follow changes to variables and methods as they happen.&lt;/p&gt;

&lt;p&gt;My last command is more of a tip of how to use a command than an actual command. While outside of a ‘do’ block, ‘exit’ will exit from the program. But while inside, it can provide valuable information about each iteration the block goes through, giving much needed debugging support.&lt;/p&gt;

&lt;p&gt;Overall, this was a very tiny piece of what I’ve learned about this project. But I’ll save that for another post. The journey continues!&lt;/p&gt;

&lt;h3&gt;
  
  
  Attribution
&lt;/h3&gt;

&lt;p&gt;Cover Photo by &lt;a href="https://unsplash.com/@jordaneil?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Jordan Sanchez&lt;/a&gt; on &lt;a href="https://unsplash.com/?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
