<?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: Khris Punzalan</title>
    <description>The latest articles on DEV Community by Khris Punzalan (@khris22).</description>
    <link>https://dev.to/khris22</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%2F417557%2F48dbd185-3fc8-4a25-a8e2-89435b71cc4b.png</url>
      <title>DEV Community: Khris Punzalan</title>
      <link>https://dev.to/khris22</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/khris22"/>
    <language>en</language>
    <item>
      <title>Deploying your Rails App On Heroku</title>
      <dc:creator>Khris Punzalan</dc:creator>
      <pubDate>Fri, 28 Aug 2020 23:19:23 +0000</pubDate>
      <link>https://dev.to/khris22/deploying-your-rails-app-on-heroku-3ofl</link>
      <guid>https://dev.to/khris22/deploying-your-rails-app-on-heroku-3ofl</guid>
      <description>&lt;p&gt;Here you are done with your project and you are ready to show it to friends and family but hey they’re not developers like you are, they don’t have a local environment setup and they will probably have no idea on how to clone your repository. Obviously the best thing to do is to deploy it so they can just a website that they can use and voila experience your app. &lt;/p&gt;

&lt;p&gt;One of the most famous  cloud based platforms that developers use is Heroku. So here’s how you can deploy your project easily:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create an account on &lt;a href="https://signup.heroku.com/devcenter"&gt;Heroku&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install the &lt;a href="https://devcenter.heroku.com/articles/heroku-cli#download-and-install"&gt;Heroku CLI&lt;/a&gt; on your machine. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;You will only do Steps 1 &amp;amp; 2 if this is your first time using Heroku.&lt;/em&gt; Now let’s move on to deploying your app. There are two ways you can do this:&lt;/p&gt;

&lt;p&gt;OPTION # 1 - Using Heroku in your browser&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--exndgIOO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d5dyvd73g0z4bimnr10q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--exndgIOO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d5dyvd73g0z4bimnr10q.png" alt="Alt Text"&gt;&lt;/a&gt; &lt;br&gt;
A. On the top right corner, click the button NEW and choose Create new app. Fill out the form with the name of your app. When you have successfully created an app on Heroku, it’s time to connect it to the app you made in your local environment. &lt;/p&gt;

&lt;p&gt;B. Run &lt;code&gt;heroku login&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;C. Then run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git init
heroku git:remote -a &amp;lt;NAME OF THE APP YOU CREATED ON HEROKU&amp;gt;
git add . 
git commit -am “&amp;lt;commit message&amp;gt;”
git push heroku master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If you already have an existing repository and does not have any changes, you can just simply run &lt;code&gt;heroku git:remote -a &amp;lt;NAME OF THE APP YOU CREATED ON HEROKU&amp;gt;&lt;/code&gt; and then &lt;code&gt;git push heroku master&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;OPTION # 2 - Using the Command Line&lt;/p&gt;

&lt;p&gt;A. On the root directory of your app, Run &lt;code&gt;heroku login&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;B. To create the app on Heroku, run &lt;code&gt;heroku create &amp;lt;NAME OF YOUR APP&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;C. To check if you have successfully created a remote repository on heroku run &lt;code&gt;git config --list | grep heroku&lt;/code&gt;. If it is confirmed then you can now push your app to heroku for deployment by running &lt;code&gt;git push heroku master&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;D. When your deployment is successful, do not forget to migrate your database and seed file if you have any:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;heroku run rake db:migrate
heroku run rake db:seed
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Do not also forget to connect the Github repository when you deploy. So if in case you there's something to want to refactor or update, it will be automatically pushed the changes to your deployed site. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--l5j8EYl---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/md870ygz01wmod9dpr8d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l5j8EYl---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/md870ygz01wmod9dpr8d.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🎉&lt;strong&gt;CONGRATULATIONS!&lt;/strong&gt;🎉 &lt;br&gt;
Now, type &lt;code&gt;heroku open&lt;/code&gt; to check out your app live!!!&lt;/p&gt;

&lt;p&gt;If you are like me who’s a big fan of trial and error approach and needs to delete the app you created on heroku by going to the app on your heroku profile, then settings. At the bottom of the page you’ll see a button that will ask you about deleting your app on heroku.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4ep-3lIp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/43ougo0imz7vjwvbxb44.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4ep-3lIp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/43ougo0imz7vjwvbxb44.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next week, we'll cover how to deploy your Rails backend to Heroku and your React frontend to Netlify.&lt;/p&gt;

&lt;p&gt;Please read &lt;a href="https://devcenter.heroku.com/articles/getting-started-with-rails6"&gt;Heroku's documentation&lt;/a&gt; for more information.&lt;/p&gt;

</description>
      <category>rails</category>
      <category>heroku</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Trekking it on Rails</title>
      <dc:creator>Khris Punzalan</dc:creator>
      <pubDate>Fri, 26 Jun 2020 18:23:20 +0000</pubDate>
      <link>https://dev.to/khris22/trekking-it-on-rails-2mc1</link>
      <guid>https://dev.to/khris22/trekking-it-on-rails-2mc1</guid>
      <description>&lt;p&gt;TrekIt is an app that I made for my Ruby on Rails project. This app is used to track outdoor activities the user has been doing.  I have started out as having really big plans and design for this project (which I will still continue to do) but then reality hit me that there was a time limit and big possibilities of debugging many errors. That seems to be the life of a programmer so I settled with the MVP (“Minimum Viable Product”) first and then plan on expanding it in the future. &lt;/p&gt;

&lt;h3&gt;
  
  
  Planning
&lt;/h3&gt;

&lt;p&gt;One of the most important things that I have learned in this project is in the planning stage. The more you plan and think about your models and its associations, the less problems you’ll encounter in the course of making your project. Since associations were discussed in our &lt;a href="https://khris22.github.io/activerecord_is_a_very_active_gem"&gt;Sinatra project&lt;/a&gt; I have been very curious about the more complex associations like &lt;code&gt;has_many&lt;/code&gt; and  &lt;code&gt;has_many: , through:&lt;/code&gt;.  This is what I wanted my project to look like. Plan A is make the MVP first which includes the User, Adventure, and Location. Once Plan A is working proceed to Plan B which is adding the Category. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://photos.google.com/share/AF1QipOO3kzcB6V2zce9EzotMa0KAIdcjXwKwSCfb2NuWUPKzK_h_dEAtEg3zsus_gAuZg?key=QmE4ODdTQkxmZ0dBNXdxQ1JhN2lLNVJ2NnJwY1hn&amp;amp;source=ctrlq.org"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DPzMFGSW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/zLNRSQYi8fFIb32-mBMbUAAbwrzJXBenziyuUNq49mJxk_UvFEJHTb460E888IcQKjBKJ1-s5sVjvWVv6fDKV0W_3-66Xkn0cVar-Ihg_BGzTS6HR8ew7IIjfZbRrVM8FjXF0bsGvw%3Dw2400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The biggest hurdle for me is not the associations but how to render the views when it is a nested resource and when it is using the same form that I have for the unnested route. There were lots of trial and error, jumping back and forth from my controller and views, rereading past lectures, and unending Google and StackOverflow search. &lt;/p&gt;

&lt;p&gt;For using the same form on your nested route hidden field is necessary so you will get the proper id:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://photos.google.com/share/AF1QipMpxp8olWWa4ANWiFBhgtFc4v6yvmSF4YtBjfMc5zwHDqXD-eX3nFMnBIi-3h6WVA?key=YzhsbUduMlR3NWR5aUxzcW4zWkMtUzBuUzdhRDVB&amp;amp;source=ctrlq.org"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FuO7fCkY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/fl2DpfjK1WSaIEBzkmNc-iq73NXu4bG2y4Dt-j4XHASk55-VZHbnEOO8YyeIz10-lMPH0Ajr_szebSFIAL0uQ9UaSzxQnlHBMcNKxCxWnjdQEtg8XLbjmxLQHXmJarCOKpCXcVaynA%3Dw2400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This helped me get the location_id in my &lt;code&gt;locations\:id\adventures&lt;/code&gt; when I am trying to create a new adventure in a particular location. I also added a custom setter for my nested attributes instead of &lt;a href="https://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html"&gt;&lt;code&gt;accept_nested_attributes_for&lt;/code&gt;&lt;/a&gt; so that there will not be any duplicates of the same exact location. If there are many adventures that happened in specific location then all the details of those adventures are located in one &lt;code&gt;:location_id&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://photos.google.com/share/AF1QipPey_SQfYh5I8dCTAHh_88X6Ko5G7t20nmt1BAGhbTcU7j7KkIRomrVdzKshqzrSg?key=NU5yTHhBOGFMTElJTjRTOV9SYTlMS2VGLWZxRWRB&amp;amp;source=ctrlq.org"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--R3sePh_H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/7k-YCf2TWug_oS5kJ0qjBrV212-zm8Ra_kkyq_ZN6UuhVwelHN5bN9pWDPVRW72PATpSA5l0Upx7LHyHRTQa5YmGzyGHmtiq4sAPpG6CdpMuYpVpJ9b_b-U2vQk4ct2sUeXR66AC5A%3Dw2400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Learning from my mistakes
&lt;/h3&gt;

&lt;p&gt;Now that I have made a project that is required for this project. I am now ready to add more it and expand. In fact, it made me want to work more and make more projects for myself. There is so much more to learn in Rails and it is definitely a powerful language to use.  I have learned a lot from making tiny mistakes in this project. In code, little things matter. It could be a spelling mistake, a wrong syntax or an order in your routes that took so much of your time but now that I know the different possibilities of where unexplainable errors are coming from, I now have a checklist in my mind what to check. &lt;/p&gt;

&lt;h3&gt;
  
  
  A big stepping stone for me!
&lt;/h3&gt;

&lt;p&gt;“Information Overload” is what I had been saying all the time going through the Rails curriculum.  There were so many challenges that I encountered for this project. It was one heck of a ride. &lt;br&gt;
I was ready to give up and have started questioning whether this is for me. Time, patience and perseverance are keys and as the old saying goes ‘slowly but surely’. Also with the great support that I have, I was get through this project.&lt;/p&gt;

&lt;p&gt;Additional Gems/Lessons that I have learned: &lt;code&gt;gem ‘omniauth-github’&lt;/code&gt;, &lt;code&gt;gem ‘faker’&lt;/code&gt;, &lt;code&gt;gem ‘dotenv-rails’&lt;/code&gt;, and &lt;code&gt;gem ‘thin’&lt;/code&gt;. I have also learned and applied bootstrap for the first time! &lt;/p&gt;

&lt;p&gt;Future Plans: Learn how to use and incorporate &lt;code&gt;gem ‘devise’&lt;/code&gt;, add additional models and scope methods!&lt;/p&gt;

&lt;p&gt;Originally Posted on December 14, 2019&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
    </item>
    <item>
      <title>Juggling JavaScript</title>
      <dc:creator>Khris Punzalan</dc:creator>
      <pubDate>Fri, 26 Jun 2020 18:19:09 +0000</pubDate>
      <link>https://dev.to/khris22/juggling-javascript-4nk6</link>
      <guid>https://dev.to/khris22/juggling-javascript-4nk6</guid>
      <description>&lt;p&gt;For my JavaScript SPA Project, I have an app called &lt;strong&gt;飲む(nomu)&lt;/strong&gt; . It is an app for cocktail lovers where the user can input their favorite cocktails, even their experimental cocktail mixes. As challenging as this project can be, I have learned so much about JavaScript and added some new Rails knowledge. I realized that there is still a lot more to learn. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Like what Socrates said, “The more I know, the more I realize I know nothing.” &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here are some of the lessons that I have learned based on the errors that I have encountered while doing this project:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Foreign Key Violation on postgresql
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1NuWvWi_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/8jWOlyPVs_nEu72jP7w2vv8mRX-0FTZYKYC0KkOX_xgjIoMJ9tgrlTwGs8w7iKcHIH5Sdk7NUj5xTutQCgm9tplngx_z-4sGyLVr0Vwz_vy-Z3J7F8QrJMX0qgzohLm_AjNNAu1HFQ%3Dw2400" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1NuWvWi_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/8jWOlyPVs_nEu72jP7w2vv8mRX-0FTZYKYC0KkOX_xgjIoMJ9tgrlTwGs8w7iKcHIH5Sdk7NUj5xTutQCgm9tplngx_z-4sGyLVr0Vwz_vy-Z3J7F8QrJMX0qgzohLm_AjNNAu1HFQ%3Dw2400" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I spent I don’t know many hours figuring out why my &lt;code&gt;destroy&lt;/code&gt; action in my controller is not working and almost gave up on this functionality. During that time, my friend and I figured out that postgres is not allowing me to delete a cocktail because ActiveRecord tried deleting an instance of a cocktail while my liquor table is still referencing it. One option that I found is adding referential integrity options set to cascade. In this it is ON DELETE. ON DELETE CASCADE will delete that instance of a cocktail and the other rows on your table associated with it. There are other options like ON DELETE SET NULL and ON DELETE RESTRICT that I could probably use as well but I will have to dig deeper into to know how they work and what option to use depending on the functionality of my application. Second option is setting the dependent option in your model like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Cocktail &amp;lt; ApplicationRecord
       has_many :liquor_cocktails, dependent: :destroy
class Liquor &amp;lt; ApplicationRecord
       has_many :liquor_cocktails, dependent: :destroy

:destroy causes all the associated objects to also be destroyed
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I went with the second option which I think is the safer way to go as I don't want to directly affect what I have in my database.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.  &lt;code&gt;.bind()&lt;/code&gt; &lt;code&gt;.this&lt;/code&gt;
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;MDN web docs definition of &lt;code&gt;.bind()&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;The bind() method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fDkAYO91--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/dasXIy9N3xLB7WqcPPo52uXYPrXe5QGx_ta9O5Yqk7X1AnAM8JjBCcvRYxuxJ3bBkUlJv-IXZpCG7LAUvkY43uY1aUcrv-8sI2Yzw6OVkdUEa42Xg_cxjHdrCDsFFXHct8QNcCHXhg%3Dw2400" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fDkAYO91--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/dasXIy9N3xLB7WqcPPo52uXYPrXe5QGx_ta9O5Yqk7X1AnAM8JjBCcvRYxuxJ3bBkUlJv-IXZpCG7LAUvkY43uY1aUcrv-8sI2Yzw6OVkdUEa42Xg_cxjHdrCDsFFXHct8QNcCHXhg%3Dw2400" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the first time I have actually seen how useful &lt;code&gt;.bind()&lt;/code&gt; is. &lt;br&gt;
So in my code above, I use &lt;code&gt;.bind()&lt;/code&gt; to invoke a function that has a parameter of &lt;code&gt;this&lt;/code&gt; meaning I want to use the same object when that function is called. In this case when I click submit in my form the values that I entered in my form is the same exact object that I want to create. What’s &lt;code&gt;this&lt;/code&gt;? This is how I think of it: this === self === Object. With &lt;code&gt;this&lt;/code&gt; object do(bind) this action.&lt;code&gt;.bind()&lt;/code&gt; acts a bridge between the object and a function is another way of thinking about it. My reference might be a little off but it has helped me understand it more. Still confused? This &lt;a href="https://youtu.be/g2WcckBB_q0"&gt;video&lt;/a&gt;  has helped understand it better.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.  &lt;code&gt;debugger&lt;/code&gt; is your best friend in JavaScript
&lt;/h3&gt;

&lt;p&gt;It’s most likely a personal preference but you should love it more than console.log()! I would not have done this project without these two though! However, &lt;code&gt;debugger&lt;/code&gt; helps me see what’s happening in my code at that moment in time. I would be blindly troubleshooting and guessing what my code is returning if I had not learned this tool and my project would probably take twice as long without learning to know how to debug. &lt;code&gt;Debugger&lt;/code&gt; has helped me fix a lot of errors and although it took me a while to fix some of them I would not have done so if there is no tool like it. This &lt;a href="https://developers.google.com/web/tools/chrome-devtools/javascript"&gt;video tutorial&lt;/a&gt;  is actually a good start to learn how to use debugger.  &lt;/p&gt;

&lt;p&gt;Originally Posted on February 22, 2020&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>rails</category>
    </item>
    <item>
      <title>trekkingIt on React Redux</title>
      <dc:creator>Khris Punzalan</dc:creator>
      <pubDate>Fri, 26 Jun 2020 18:13:22 +0000</pubDate>
      <link>https://dev.to/khris22/trekkingit-on-react-redux-3g</link>
      <guid>https://dev.to/khris22/trekkingit-on-react-redux-3g</guid>
      <description>&lt;p&gt;For my final project, I have gone back to what I have focused my past projects on, an adventure tracker which I named trekIt. It’s an app for people like me and my partner who are fond of doing outdoor activities. The idea came from a real map that we have in our house where we put a pin on every park that we have been to and explored. It gives us a sense of accomplishment that we can visually see and track these locations and it makes us excited and motivated to have a goal hence the digital map on this app so we can carry it wherever we go.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--r3cqOAeG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.postimg.cc/TYsFqC8M/Screen-Shot-2020-04-25-at-7-30-33-AM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--r3cqOAeG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.postimg.cc/TYsFqC8M/Screen-Shot-2020-04-25-at-7-30-33-AM.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To make that happen, I know that I will have to use an api that will help me render this map. At first, I was leaning towards using &lt;a href="https://developers.google.com/maps/documentation"&gt;Google Maps Api&lt;/a&gt; and then my cohort lead suggested &lt;a href="https://www.mapbox.com/"&gt;MapBox&lt;/a&gt; so I gave it a shot. The Mapbox api has good documentation but it’s mostly targeted for Javascript so I went into this rabbit hole of trying to make it work for this project. I almost gave up and went back to my first option of using google but I found out that Uber has created a &lt;a href="https://visgl.github.io/react-map-gl/"&gt;React wrapper for Mapbox&lt;/a&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5UHoLBae--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.postimg.cc/TwYvH1CZ/Screen-Shot-2020-04-18-at-8-15-56-AM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5UHoLBae--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.postimg.cc/TwYvH1CZ/Screen-Shot-2020-04-18-at-8-15-56-AM.png" alt=""&gt;&lt;/a&gt;&lt;br&gt;
That made my life a little easier and I started making good progress producing a map. This wrapper has its own component that you can import to render the map. It also has its own Markers and Popup component that you can easily use to add to your map. In my mapbox component, I have also passed down the state of my app as props so that the users can render markers on the map of all the locations they have saved. &lt;/p&gt;

&lt;p&gt;There are so many things that I have learned from this section of the curriculum and here are a few of them:&lt;/p&gt;

&lt;p&gt;Props and State&lt;/p&gt;

&lt;p&gt;At the beginning of the curriculum, I was so confused with the difference of these two words! &lt;code&gt;Props&lt;/code&gt; is short for “properties”. These are passed into the components from parent to children. &lt;code&gt;State&lt;/code&gt;, on the other hand, holds information/data about the component. &lt;code&gt;State&lt;/code&gt; is changeable using &lt;code&gt;setState&lt;/code&gt;. &lt;code&gt;this.setState&lt;/code&gt; will only cause a rerender of a particular component and its children but &lt;code&gt;props&lt;/code&gt; is not changeable or should not change. They are immutable. &lt;/p&gt;

&lt;p&gt;Redux&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PF6qvqpP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.postimg.cc/3wGZ5FbG/Screen-Shot-2020-04-09-at-3-07-11-PM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PF6qvqpP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.postimg.cc/3wGZ5FbG/Screen-Shot-2020-04-09-at-3-07-11-PM.png" alt=""&gt;&lt;/a&gt;&lt;br&gt;
Image Source: &lt;a href="http://codesheep.io/2017/01/06/redux-architecture/"&gt;http://codesheep.io/2017/01/06/redux-architecture/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This resource was shared to us by our cohort lead. Since I am a visual learner I have learn the flow of what is going on behind the scenes when developers choose to use redux. &lt;/p&gt;

&lt;p&gt;With Redux, it helps us manage the state of our application that is kept in a store. That being said, since our state is  just in one place we are able to access from any component without having to send down props from one component to another. &lt;/p&gt;

&lt;p&gt;The core concepts of Redux are store, actions and reducers. In the &lt;code&gt;store&lt;/code&gt;, we keep all of our data, &lt;code&gt;actions&lt;/code&gt;, based on the word itself, are the things we can do to our store and &lt;code&gt;reducers&lt;/code&gt; act as a bridge between the store and the actions. It basically gets order from the actions and it decides how the store should be changed/updated.&lt;/p&gt;

&lt;p&gt;Originally Posted on April 25, 2020&lt;/p&gt;

</description>
      <category>react</category>
      <category>redux</category>
      <category>rails</category>
    </item>
  </channel>
</rss>
