<?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: Nicolás Gómez</title>
    <description>The latest articles on DEV Community by Nicolás Gómez (@codewithnico).</description>
    <link>https://dev.to/codewithnico</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%2F448084%2F538b98d4-4ba9-45ed-99a3-4e75772cafb2.jpg</url>
      <title>DEV Community: Nicolás Gómez</title>
      <link>https://dev.to/codewithnico</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codewithnico"/>
    <language>en</language>
    <item>
      <title>¿Qué es lo mínimo que debes saber para considerarte full stack developer?</title>
      <dc:creator>Nicolás Gómez</dc:creator>
      <pubDate>Thu, 14 Jan 2021 00:19:38 +0000</pubDate>
      <link>https://dev.to/codewithnico/que-es-lo-minimo-que-debes-saber-para-considerarte-full-stack-developer-5262</link>
      <guid>https://dev.to/codewithnico/que-es-lo-minimo-que-debes-saber-para-considerarte-full-stack-developer-5262</guid>
      <description>&lt;p&gt;Muchos dicen que para ser full stack tienes que saber mil cosas e incluso que los desarrolladores full stack no existen (o que son unicornios 🦄).&lt;/p&gt;

&lt;p&gt;La razón de esto es que los full stack se mueven en distintas capas de un proyecto de software: en lo relacionado a interfaz de usuario (frontend), en la parte de procesamiento y entrega de datos (backend), entre otras cosas. Y para dominar cada una, se necesita manejar muchas herramientas.&lt;/p&gt;

&lt;p&gt;Como cada mundo involucra miles de tecnologías, ahora nos hacemos la pregunta: &lt;strong&gt;¿qué es lo mínimo que debe saber un desarrollar para considerarse full stack?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Definición de un desarrollador full stack
&lt;/h2&gt;

&lt;p&gt;Antes es importante ponernos de acuerdo de qué es un desarrollador full stack.&lt;/p&gt;

&lt;p&gt;Muchos piensan que un full stack debe dominar todas las tecnologías de &lt;em&gt;frontend&lt;/em&gt; y de &lt;em&gt;backend&lt;/em&gt;. Algo difícil de lograr...&lt;/p&gt;

&lt;p&gt;A mí me gusta usar una definición más amplia:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Desarrollador full stack:&lt;/strong&gt; Alguien que es capaz de crear una aplicación que involucre interacción con usuarios finales y también procesamiento y entrega de datos.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Esta definición tiene 2 consecuencias:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Se basa en lo que &lt;strong&gt;una persona es capaz de lograr&lt;/strong&gt; y no a lo que se supone que sabe.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Las tecnologías y herramientas quedan en segundo plano&lt;/strong&gt;, a servicio del profesional. Tal y como debe ser.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Ahora sí... Lo mínimo que tienes que saber para considerarte full stack
&lt;/h2&gt;

&lt;p&gt;Debido a la definición anterior, tienes que saber crear aplicaciones que involucren el mundo del &lt;em&gt;frontend&lt;/em&gt; (interfaz de usuario) y del &lt;em&gt;backend&lt;/em&gt; (entrega y procesamiento de datos).&lt;/p&gt;

&lt;p&gt;Como son muchas aristas y tecnologías, el full stack es capaz de complementar los conocimientos que tenga más débiles o que no le interesen.&lt;/p&gt;

&lt;p&gt;Hay muchas combinaciones que logran esto:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;En vez de aprender sobre servidores, devOps y sistemas operativos (donde colocas tu aplicación "backend") puedes aprender una herramienta tipo &lt;a href="https://heroku.com"&gt;Heroku&lt;/a&gt; que hace todo esto por ti.&lt;/li&gt;
&lt;li&gt;En vez de aprender a crear backend complejos desde 0 puedes utilizar un framework con muchas cosas ya hechas (&lt;a href="https://rubyonrails.org/"&gt;Ruby on rails&lt;/a&gt;, &lt;a href="https://www.djangoproject.com/"&gt;Django&lt;/a&gt;, &lt;a href="https://laravel.com/"&gt;Laravel&lt;/a&gt;) o incluso puedes usar "backend as a service" tipo &lt;a href="http://firebase.com/"&gt;Firebase&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;En vez de aprender a hacer frameworks frontend desde 0 puedes usar herramientas ya existentes como &lt;a href="https://angular.io/"&gt;Angular&lt;/a&gt;, &lt;a href="https://vuejs.org/"&gt;Vue&lt;/a&gt; o &lt;a href="https://vuejs.org/"&gt;React&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;En vez de aprender CSS puedes usar templates ya hechos.&lt;/li&gt;
&lt;li&gt;En vez de aprender a desarrollar en Android (Java/Kotlin) e iPhone (Swift) puedes usar &lt;a href="https://reactnative.dev/"&gt;React native&lt;/a&gt; (javascript) o &lt;a href="https://flutter.dev/"&gt;Flutter&lt;/a&gt; (Dart) para crear plataformas en ambas plataformas.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Esto nos abre las puertas a muchos perfiles interesantes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ejemplos de perfiles de desarrollador full stack
&lt;/h2&gt;

&lt;p&gt;Algunos ejemplos de perfiles full stack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Javascript con jQuery + Firebase&lt;/li&gt;
&lt;li&gt;Ruby on rails en AWS on react&lt;/li&gt;
&lt;li&gt;React Native con Django en un VPS&lt;/li&gt;
&lt;li&gt;React native con Nodejs sobre Heroku&lt;/li&gt;
&lt;li&gt;Vue con Laravel en docker sobre AWS&lt;/li&gt;
&lt;li&gt;AWS Amplify&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Mi elección personal
&lt;/h2&gt;

&lt;p&gt;Yo me considero un desarrollador full stack por que he hecho varias aplicaciones que involucran ambos mundos de manera exitosa. &lt;/p&gt;

&lt;p&gt;Para que tengas una referencia, mis elecciones tecnológicas son:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Backend&lt;/em&gt;: me considero buen backend con Ruby on Rails (RoR). Lo aprendí mientras estudiaba y desde ahí que quedé enamorado del framework. También manejo bien node.js, pero mi elección casi siempre es RoR.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Frontend&lt;/em&gt;: por temas de trabajo tuve que aprender React. No me encanta, pero hace bien su trabajo.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;UI&lt;/em&gt;: no soy experto en CSS. Por eso, suelo utilizar frameworks de CSS, como por ejemplo Bootstrap o AntDesign.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Devops&lt;/em&gt;: nunca me gustó lo relacionado con servidores. Así que mi elección es utilizar Heroku.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>spanish</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to style your React application?</title>
      <dc:creator>Nicolás Gómez</dc:creator>
      <pubDate>Thu, 17 Sep 2020 20:46:46 +0000</pubDate>
      <link>https://dev.to/codewithnico/how-to-style-your-react-application-3obc</link>
      <guid>https://dev.to/codewithnico/how-to-style-your-react-application-3obc</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;I built my first app. It works. Now how the heck do I go about styling it?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3y7sSBE9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/component-2-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3y7sSBE9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/component-2-.png" alt="How to style your React application?"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When building a React application, you get to a point where it is fully functional but it doesn't look like you want.&lt;/p&gt;

&lt;p&gt;We as developers focus on how things work, not on how they look. Until we realize that our little baby is ugly 😭 so then we start styling and resizing here and there to make it prettier.&lt;/p&gt;

&lt;p&gt;But how the heck can we style all of them in a way that is efficient and makes sense?&lt;/p&gt;

&lt;h2&gt;
  
  
  The fastest way to style your React app
&lt;/h2&gt;

&lt;p&gt;As you may be guessing, the fastest way to style your React app is by using a &lt;em&gt;UI library&lt;/em&gt; that do all the heavy lifting for you.&lt;/p&gt;

&lt;p&gt;When using UI libraries, instead of playing with margins, paddings and sizes, you just use the components the library provides. In the end, you save time and win styling consistence.&lt;/p&gt;

&lt;p&gt;The next question is: &lt;em&gt;What UI library should you use?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;There is not an "industry standard" when choosing library, but the &lt;a href="https://maxrozen.com/guide-to-component-ui-libraries-react/"&gt;commonly&lt;/a&gt; used are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ant.design/"&gt;Ant Design&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://reactstrap.github.io/"&gt;Bootstrap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/couds/react-bulma-components"&gt;Bulma&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://chakra-ui.com/"&gt;Chakra UI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://material-ui.com/"&gt;Material UI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://semantic-ui.com/"&gt;Semantic UI&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My personal choice is Bootstrap or Ant Design. Bootstrap for simple apps without many functionalities and Ant Design for the rest.&lt;/p&gt;

&lt;p&gt;Why Bootstrap? I have experience building static sites with HTML + CSS + Bootstrap. So, I can leverage my knowledge in this framework with React.&lt;/p&gt;

&lt;p&gt;Why AntD? Two reasons. The first one: &lt;strong&gt;the documentation is awesome&lt;/strong&gt;. I rarely google AntD stuff when using this framework. The second reason is that &lt;strong&gt;it has MANY components&lt;/strong&gt;. When using it, I feel like they have though in everything. Its magic.&lt;/p&gt;

&lt;p&gt;MaterialUI documentation is pretty good too. But in my experience it is a bit harder to customize and I feel like all apps made with material design looks like Google apps. Which is not bad BTW, I just don't like it.&lt;/p&gt;

&lt;p&gt;I can't say much about the rest because I haven't used them, but I know that they are safe bets. So, my advice is: &lt;strong&gt;choose the one that looks similar to what you want to accomplish&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;At some point in the project, you will realize that your app needs some personalized touch. Which leaves us to...&lt;/p&gt;

&lt;h2&gt;
  
  
  Color personalization: how to choose your App colors?
&lt;/h2&gt;

&lt;p&gt;Many libraries have primary or secondary colors you can change. The defaults are good, but what if you want to add &lt;em&gt;personality&lt;/em&gt; to your app? What colors should you use?&lt;/p&gt;

&lt;p&gt;My design knowledge is zero. So, I usually use palette color tools such as &lt;a href="https://colorhunt.co/"&gt;colorhunt&lt;/a&gt; or &lt;a href="https://coolors.co/"&gt;coolors&lt;/a&gt;, where you can pick one visually:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hC14UfI---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/Screen-Shot-2020-09-17-at-14.42.50.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hC14UfI---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/Screen-Shot-2020-09-17-at-14.42.50.png" alt="How to style your React application?"&gt;&lt;/a&gt;Color Hunt example&lt;/p&gt;

&lt;p&gt;For a &lt;a href="https://impuestos.netlify.app/"&gt;Chilean Tax payment calculator&lt;/a&gt; I made, the colors I used was a variation of &lt;a href="https://colorhunt.co/palette/22672"&gt;this palette&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6baK-fr0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://codewithnico.com/content/images/2020/09/impuestos-demo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6baK-fr0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://codewithnico.com/content/images/2020/09/impuestos-demo.gif" alt="How to style your React application?"&gt;&lt;/a&gt;Color hunt in action&lt;/p&gt;

&lt;p&gt;Using palettes, you can choose one that looks good for your project.&lt;/p&gt;

&lt;p&gt;If you already know the main color, you can use &lt;a href="https://color.adobe.com/create/color-wheel"&gt;Adobe Color Wheel&lt;/a&gt; to get the rest:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HELNzcxv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/Screen-Shot-2020-09-17-at-15.41.47.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HELNzcxv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/Screen-Shot-2020-09-17-at-15.41.47.png" alt="How to style your React application?"&gt;&lt;/a&gt;Adobe Color Wheel&lt;/p&gt;

&lt;p&gt;Personalization is not all about colors. Sometimes you will have to make a component and styles by yourself.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://medium.com/refactoring-ui/7-practical-tips-for-cheating-at-design-40c736799886"&gt;7 Practical Tips for Cheating at Design&lt;/a&gt; is a good post to avoid common design mistakes and to make your apps looks more professional.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are many ways to add styles to your React components. See &lt;a href="https://www.robinwieruch.de/react-css-styling"&gt;How to CSS Style in React&lt;/a&gt; for a good summary of the approaches. I have been used mostly &lt;a href="https://cssinjs.org/?v=v10.4.0"&gt;css-in-js&lt;/a&gt; with &lt;a href="https://cssinjs.org/react-jss/?v=v10.4.0"&gt;react-jss&lt;/a&gt;, but I don't have a strong opinion about this.&lt;/p&gt;

&lt;p&gt;If you're lacking of design ideas, knowing how to add your own style is not enough. And when you're lacking of ideas...&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to look for inspiration?
&lt;/h2&gt;

&lt;p&gt;When I'm lost, I usually go to &lt;a href="https://dribbble.com/shots/following/web-design"&gt;Dribbble&lt;/a&gt; for inspiration. Or I look at the apps I already use.&lt;/p&gt;

&lt;p&gt;For example, I was building an app with Chat functionality and the framework (&lt;a href="https://ionicframework.com/docs/react"&gt;React with Ionic&lt;/a&gt;) didn't have components for this use case. I ended with this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HQa5M_If--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/Screen-Shot-2020-09-17-at-15.53.16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HQa5M_If--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/Screen-Shot-2020-09-17-at-15.53.16.png" alt="How to style your React application?"&gt;&lt;/a&gt;Chat example&lt;/p&gt;

&lt;p&gt;Which was based in this &lt;a href="https://dribbble.com/shots/6261272-Mobile-Leaderboard"&gt;dribbble&lt;/a&gt; and on &lt;a href="https://www.messenger.com/"&gt;Facebook Messenger&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final notes
&lt;/h2&gt;

&lt;p&gt;In summary:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The fastest way to make a good-looking React app is by using a UI library. Choosing a &lt;a href="https://maxrozen.com/guide-to-component-ui-libraries-react/"&gt;popular&lt;/a&gt; one is a safe bet, so choose one based on what you are going to build.&lt;/li&gt;
&lt;li&gt;The low-hanging fruits in personalization are colors. To choose a good set of colors, you can use &lt;a href="https://colorhunt.co/"&gt;Color Hunt&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;When the UI framework is not enough, you'll need to make a custom component from scratch. You can use &lt;a href="https://medium.com/refactoring-ui/7-practical-tips-for-cheating-at-design-40c736799886"&gt;tactics&lt;/a&gt; to improve your design and you have &lt;a href="https://www.robinwieruch.de/react-css-styling"&gt;many choices&lt;/a&gt; to style it. Lacking of ideas? Use &lt;a href="https://dribbble.com/shots/following/web-design"&gt;Dribbble&lt;/a&gt; for inspiration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Bonus:&lt;/strong&gt; just found &lt;a href="https://github.com/bradtraversy/design-resources-for-developers"&gt;Design Resources for Developer&lt;/a&gt; in GitHub, looks awesome!&lt;/p&gt;

</description>
      <category>react</category>
    </item>
    <item>
      <title>What is useRef for? When should I use it?</title>
      <dc:creator>Nicolás Gómez</dc:creator>
      <pubDate>Wed, 09 Sep 2020 20:24:22 +0000</pubDate>
      <link>https://dev.to/codewithnico/what-is-useref-for-when-should-i-use-it-1ng2</link>
      <guid>https://dev.to/codewithnico/what-is-useref-for-when-should-i-use-it-1ng2</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--e5V1FQYV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/component-1-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e5V1FQYV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/component-1-.png" alt="What is useRef for? When should I use it?"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have tried reading the docs over and over again but you still don't understand &lt;em&gt;useRef&lt;/em&gt;, this post is for you!&lt;/p&gt;

&lt;h3&gt;
  
  
  What is useRef?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;useRef&lt;/code&gt; is like a box where you can store something for later use. A number, an object, anything you want.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qc-kydin--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/imagen-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qc-kydin--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/imagen-1.png" alt="What is useRef for? When should I use it?"&gt;&lt;/a&gt;useRef&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;thing&lt;/em&gt; you save in this box is &lt;em&gt;preserved&lt;/em&gt; between renders, similar to &lt;code&gt;useState&lt;/code&gt;. In other words, &lt;em&gt;the box&lt;/em&gt; is not destroyed when your component is updated.&lt;/p&gt;

&lt;p&gt;And when you change the box content, nothing happens to the component. The box content changes, but the component remains the same.&lt;/p&gt;

&lt;p&gt;Observations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unlike component state variables (&lt;code&gt;useState&lt;/code&gt;), updating a ref value doesn't trigger a new render.&lt;/li&gt;
&lt;li&gt;Are you coming from class components? Ok, it is like storing something in an instance variable (&lt;code&gt;this.value = someValue&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What is it used for?
&lt;/h3&gt;

&lt;p&gt;Ok, cool. &lt;code&gt;useRef&lt;/code&gt; is used to store something in the component "memory" but it doesn't trigger a new render when the value is updated.&lt;/p&gt;

&lt;p&gt;But what is it used for?&lt;/p&gt;

&lt;p&gt;Well, there are two main use cases:&lt;/p&gt;

&lt;h3&gt;
  
  
  1) &lt;strong&gt;To store DOM elements&lt;/strong&gt; so you can later do something with it.
&lt;/h3&gt;

&lt;p&gt;For example, you can focus the password input when the user press "ENTER" on the email input:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zUBlBApy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://codewithnico.com/content/images/2020/09/no-click.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zUBlBApy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://codewithnico.com/content/images/2020/09/no-click.gif" alt="What is useRef for? When should I use it?"&gt;&lt;/a&gt;Focus the next element when pressing "ENTER"&lt;/p&gt;

&lt;p&gt;You can do it with &lt;code&gt;useRef&lt;/code&gt; (&lt;a href="https://codesandbox.io/s/nostalgic-torvalds-irewu?file=/src/App.js"&gt;source code&lt;/a&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;App&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;emailRef&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useRef&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;passwordRef&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useRef&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="nt"&gt;div&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;"App"&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;p&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;label&lt;/span&gt; &lt;span class="na"&gt;htmlFor&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Email:&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&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="nt"&gt;input&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;"email"&lt;/span&gt;
          &lt;span class="na"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;emailRef&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
          &lt;span class="na"&gt;onKeyPress&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="nx"&gt;charCode&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;charCode&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
              &lt;span class="nx"&gt;passwordRef&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;focus&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="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="nt"&gt;p&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;p&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;label&lt;/span&gt; &lt;span class="na"&gt;htmlFor&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"password"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Password:&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&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="nt"&gt;input&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;"password"&lt;/span&gt; &lt;span class="na"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;passwordRef&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="nt"&gt;p&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;div&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;
useRef example to store reference to an input component





&lt;h3&gt;
  
  
  2) To store values you want to keep an eye on
&lt;/h3&gt;

&lt;p&gt;Sometimes you want to keep an eye on a value but you don't need to trigger new renders when it changes.&lt;/p&gt;

&lt;p&gt;Example: &lt;a href="https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state"&gt;storing the previous value of a state variable&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This is a simple application that display a counter and its previous values. It also has two buttons to increase the counter (by 1 and by 10):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---eiObwOi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://codewithnico.com/content/images/2020/09/Sep-09-2020-17-16-14.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---eiObwOi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://codewithnico.com/content/images/2020/09/Sep-09-2020-17-16-14.gif" alt="What is useRef for? When should I use it?"&gt;&lt;/a&gt;Example of useRef to store a previous value&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codesandbox.io/s/previous-value-with-useref-doh5p"&gt;Source code&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;Counter&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="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&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;prevCountRef&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useRef&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;prevCountRef&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;count&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;prevCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;prevCountRef&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&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="nt"&gt;div&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;"App"&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;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Previous value with useRef&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&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;p&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;button&lt;/span&gt; &lt;span class="na"&gt;onClick&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;value&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="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
          Increase counter by 1
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&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;button&lt;/span&gt; &lt;span class="na"&gt;onClick&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&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;
          Increase counter by 10
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&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;p&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;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        Now: &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;, before: &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;prevCount&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&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;div&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;
useRef to store a previous value





</description>
      <category>react</category>
    </item>
    <item>
      <title>How to manage snake case for backend (Django, Rails) and camel case for React?</title>
      <dc:creator>Nicolás Gómez</dc:creator>
      <pubDate>Tue, 28 Jul 2020 16:43:51 +0000</pubDate>
      <link>https://dev.to/codewithnico/how-to-manage-snake-case-for-backend-django-rails-and-camel-case-for-react-1502</link>
      <guid>https://dev.to/codewithnico/how-to-manage-snake-case-for-backend-django-rails-and-camel-case-for-react-1502</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uWXvASfI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/size/w1000/2020/09/component.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uWXvASfI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/size/w1000/2020/09/component.png" alt="How to manage snake case for backend (Django, Rails) and camel case for React?"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let say that your backend framework is Django or Rails. The data you get and send must be in snake_case because this is the convention in these frameworks.&lt;/p&gt;

&lt;p&gt;But when handling this data in your React App, you'll be using JavaScript where the convention is camelCase...&lt;/p&gt;

&lt;p&gt;How can you solve this without making your Linter go mad? Should you break the convention for either Rails or React?&lt;/p&gt;

&lt;p&gt;If you don't mind breaking name conventions, go ahead and use snake case in your React App (sorry Linter! 💔)&lt;/p&gt;

&lt;p&gt;For the rest of us, I have a solution:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;after&lt;/em&gt; retrieving data from your backend, transform it to camelCase&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;before&lt;/em&gt; sending data to your backend, transform it to snake_case&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why in client code you might ask? Well, because 99% of the time you will be adding somekind of &lt;em&gt;fetch&lt;/em&gt; wrapper in your app (for example, to transform the responses to JSON). Just extend it a little.&lt;/p&gt;

&lt;h2&gt;
  
  
  Show me the code
&lt;/h2&gt;

&lt;p&gt;The transformation is easy because there are packages for it. I'll be using &lt;a href="https://www.npmjs.com/package/humps"&gt;humps&lt;/a&gt;, which is a Underscore-to-camelCase converter (and vice versa) for strings and object keys in JavaScript.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;after&lt;/em&gt; retrieving data from your backend, transform it to camelCase:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// api.js&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;humps&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;humps&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;response&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="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;humps&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;camelizeKeys&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="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
get wrapper





&lt;blockquote&gt;
&lt;p&gt;before sending data to your backend, transform it to snakeCase&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// api.js&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;humps&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;humps&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;humps&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;decamelizeKeys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&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="nx"&gt;body&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;response&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="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;humps&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;camelizeKeys&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
post wrapper





&lt;p&gt;Then in your React components use your new functions and you're done!&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EY7JLDJe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/Screen-Shot-2020-09-07-at-15.39.27.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EY7JLDJe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/Screen-Shot-2020-09-07-at-15.39.27.png" alt="How to manage snake case for backend (Django, Rails) and camel case for React?"&gt;&lt;/a&gt;&lt;a href="https://codesandbox.io/s/distracted-wilbur-zr914?file=/src/App.js"&gt;Demo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is the code of &lt;a href="https://codesandbox.io/s/distracted-wilbur-zr914?file=/src/App.js"&gt;example App&lt;/a&gt; using &lt;a href="https://pokeapi.co/docs/v2"&gt;PokeApi&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="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="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useEffect&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="s2"&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./styles.css&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="kd"&gt;get&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="s2"&gt;./api&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;PokemonCard&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;pokemon&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setPokemon&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`/pokemon/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;setPokemon&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;pokemon&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&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;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;pokemon&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sprites&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;frontDefault&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// camelCase :D&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="nt"&gt;div&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;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;96&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;96&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;inline-block&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;backgroundImage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`url(&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;src&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="si"&gt;}&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;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;App&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="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;pokemons&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setPokemons&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;([]);&lt;/span&gt;

  &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/pokemon?limit=150&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;setPokemons&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;results&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="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="nt"&gt;div&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;"App"&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;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Pokemons!&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&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;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;pokemons&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;PokemonCard&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;name&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;))&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&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;div&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;
Example App using our API wrapper





&lt;h2&gt;
  
  
  Why it works
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Most React apps needs some-kind of wrapper for requests. It could be to transform all requests to JSON, to add authentication tokens, etc. So extending the wrapper a little for transformations is okay and straightforward.&lt;/li&gt;
&lt;li&gt;Sometimes you won't be able to touch your backend code. In this case, any transformation should be done in client (React) anyway.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>react</category>
      <category>rails</category>
      <category>django</category>
    </item>
    <item>
      <title>List of Open Source React projects on GitHub to learn from</title>
      <dc:creator>Nicolás Gómez</dc:creator>
      <pubDate>Sun, 10 May 2020 23:15:10 +0000</pubDate>
      <link>https://dev.to/codewithnico/list-of-open-source-react-projects-on-github-to-learn-from-5gbi</link>
      <guid>https://dev.to/codewithnico/list-of-open-source-react-projects-on-github-to-learn-from-5gbi</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---BMSfMm4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/component-7-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---BMSfMm4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/component-7-.png" alt="List of Open Source React projects on GitHub to learn from"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you grow your knowledge in React.js, you will notice that there are many sources with simple code examples but only a few of advanced stuff. And many of them have "outdated code" (no hooks, class components everywhere, etc).&lt;/p&gt;

&lt;p&gt;What if you want to know how to structure a medium to large codebase? Or if you want to know if you are doing everything fine?&lt;/p&gt;

&lt;p&gt;One way to improve your skills is to study what other devs are doing. How they approach their projects can teach you lessons that maybe will take you weeks to learn.&lt;/p&gt;

&lt;p&gt;That's why I made this list of open-source React.js applications you can learn from. All uses modern features such hooks, context and many uses redux-toolkit. So, no matter if you already have hit a plateau as seasoned developer or if you're just starting, take a look!&lt;/p&gt;

&lt;h2&gt;
  
  
  1) Take Note – &lt;a href="https://takenote.dev/"&gt;Live&lt;/a&gt; | &lt;a href="https://github.com/taniarascia/takenote"&gt;Repo&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Take Note is an open-source project to take notes, known as &lt;em&gt;The Note Taking App for Developers&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--seslgYFS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--seslgYFS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen.png" alt="Take note preview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's a simple plain-text take note app with markdown support. Without all the fancy stuff that we don't need :)&lt;/p&gt;

&lt;p&gt;The code seems to be good organized:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UBrJySoq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UBrJySoq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-1.png" alt="React app code structure"&gt;&lt;/a&gt;React app code structure&lt;/p&gt;

&lt;p&gt;It uses React hooks (yay!) and &lt;a href="https://redux-toolkit.js.org/https://redux-toolkit.js.org/https://redux-toolkit.js.org/https://redux-toolkit.js.org/"&gt;redux-toolkit&lt;/a&gt; =) (see the &lt;em&gt;slices&lt;/em&gt; folder).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qHhDW3sN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qHhDW3sN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-2.png" alt="auth.ts, authentication slice using redux toolkit"&gt;&lt;/a&gt;auth.ts, authentication slice using redux toolkit&lt;/p&gt;

&lt;h2&gt;
  
  
  2) Cloud Music - &lt;a href="https://github.com/sanyuan0704/react-cloud-music"&gt;Repo&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;This is a clone of &lt;em&gt;NetEase&lt;/em&gt;, a cloud music streaming service. The README is in Chinese but the code is in plain English.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7TckhLZ8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://codewithnico.com/content/images/2020/05/68747470733a2f2f757365722d676f6c642d63646e2e786974752e696f2f323031392f382f31312f313663376637333562383361306431353f773d33373226683d36363826663d67696626733d32383536343637.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7TckhLZ8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://codewithnico.com/content/images/2020/05/68747470733a2f2f757365722d676f6c642d63646e2e786974752e696f2f323031392f382f31312f313663376637333562383361306431353f773d33373226683d36363826663d67696626733d32383536343637.gif" alt="Demo, GIF from README"&gt;&lt;/a&gt;GIF from README&lt;/p&gt;

&lt;p&gt;This project uses redux (without redux-toolkit) and hooks. What I find interesting in this project is the code structure:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2zBW53Te--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2zBW53Te--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-3.png" alt="react-cloud music code structure"&gt;&lt;/a&gt;react-cloud music code structure&lt;/p&gt;

&lt;p&gt;At first, it seems pretty standard but after reviewing the reducer (&lt;em&gt;store/reducer.js&lt;/em&gt;) I noticed that they are "grouping" (inside &lt;em&gt;application&lt;/em&gt; folder) some components and styles alongside the &lt;em&gt;redux&lt;/em&gt; logic:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--s4ojK_op--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--s4ojK_op--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-4.png" alt="Example of grouping files by feature"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3) Todoist clone - &lt;a href="https://github.com/karlhadwen/todoist"&gt;Repo&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/channel/UC1DUQiZduv_yNZy0O7n_iHA"&gt;Karl Hadwen&lt;/a&gt; did this &lt;a href="https://todoist.com/es"&gt;Todoist&lt;/a&gt; clone, and he even has a &lt;a href="https://www.youtube.com/watch?v=HgfA4W_VjmI"&gt;video tutorial&lt;/a&gt; on Youtube.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CII9I5F6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CII9I5F6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-7.png" alt="Screenshot from README.me"&gt;&lt;/a&gt;Screenshot from README.me&lt;/p&gt;

&lt;p&gt;For the &lt;em&gt;"backend"&lt;/em&gt;, he used &lt;a href="https://firebase.google.com/"&gt;Firebase&lt;/a&gt;instead of building an API from scratch. He used context and didn't use redux (yes, you don't always need to use redux).&lt;/p&gt;

&lt;h2&gt;
  
  
  4) Mortgage – &lt;a href="https://paulhoughton.github.io/mortgage/"&gt;Live&lt;/a&gt; | &lt;a href="https://github.com/paulhoughton/mortgage"&gt;Repo&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Mortgage&lt;/em&gt; is a mortgage overpayment calculator!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tCWIfC7k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tCWIfC7k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-8.png" alt="Screenshot from Live website"&gt;&lt;/a&gt;Screenshot from Live website&lt;/p&gt;

&lt;p&gt;It uses &lt;a href="https://d3js.org/"&gt;D3&lt;/a&gt; to draw the chart and hooks! It is a small app but it is a good start to learn how to use hooks in calculator-like applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  5) Tomato Work – &lt;a href="https://tomato-work.xiejiahe.com/"&gt;Live&lt;/a&gt; | &lt;a href="https://github.com/xjh22222228/tomato-work"&gt;Repo&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Tomato-work is a personal affairs management system written in React using hooks and redux:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Sfwz57ek--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://codewithnico.com/content/images/2020/05/1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Sfwz57ek--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://codewithnico.com/content/images/2020/05/1.gif" alt="Live demo, took from README"&gt;&lt;/a&gt;Live demo from README&lt;/p&gt;

&lt;p&gt;For the UI, it uses &lt;a href="https://ant.design/"&gt;Antd&lt;/a&gt;, which is pretty awesome BTW. The code structure is standard:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--29N8PF98--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--29N8PF98--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-9.png" alt="Code structure"&gt;&lt;/a&gt;Code structure&lt;/p&gt;

&lt;p&gt;What I find interesting is that it has a &lt;em&gt;services&lt;/em&gt; folder (remind me of angular) where each file is an abstraction to make API calls. So instead of calling axios directly in the component, he uses a service function instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  6) Write with me – &lt;a href="https://www.writewithme.dev"&gt;Live&lt;/a&gt; | &lt;a href="https://github.com/dabit3/write-with-me"&gt;Repo&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Write with me&lt;/em&gt; is a real-time collaborative markdown editor written in React with hooks and it uses &lt;a href="https://aws.amazon.com/es/amplify/"&gt;AWS Amplify&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GfhbXGDi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://codewithnico.com/content/images/2020/05/writewithme.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GfhbXGDi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://codewithnico.com/content/images/2020/05/writewithme.gif" alt="Demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, this is a small project:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1QfxW39o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1QfxW39o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-10.png" alt="Code structure"&gt;&lt;/a&gt;Code structure&lt;/p&gt;

&lt;p&gt;So, the code structure is not organized using different folders. All the state management is done using &lt;code&gt;useReducer&lt;/code&gt; hooks.&lt;/p&gt;

&lt;p&gt;There is a &lt;code&gt;graphql&lt;/code&gt; folder because Amplify works with graphql&lt;/p&gt;

&lt;h2&gt;
  
  
  7) JIRA Clone – &lt;a href="https://jira.ivorreic.com/project/board"&gt;Live&lt;/a&gt; | &lt;a href="https://github.com/oldboyxx/jira_clone"&gt;Repo&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;This is a simplified JIRA Clone, looks awesome!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qzLmBuuA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-11.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qzLmBuuA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-11.png" alt="Screenshot from the live website"&gt;&lt;/a&gt;Screenshot from the live website&lt;/p&gt;

&lt;p&gt;Analyzing the code structure, you can see it uses cypress and jest for testing:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H6moQ2oY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-12.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H6moQ2oY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-12.png" alt="Code structure"&gt;&lt;/a&gt;Code structure&lt;/p&gt;

&lt;p&gt;As the author says, it is a good example of a modern real-world React codebase. There are the features (from README):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eT4-gln4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-13.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eT4-gln4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/05/imagen-13.png" alt="List of features"&gt;&lt;/a&gt;The project features from README&lt;/p&gt;

&lt;h2&gt;
  
  
  8) Spectrum – &lt;a href="https://spectrum.chat/"&gt;Live&lt;/a&gt; | &lt;a href="https://github.com/withspectrum/spectrum"&gt;Repo&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Spectrum is a platform that allows you to create and participate in awesome communities.&lt;/p&gt;

&lt;p&gt;I have seen many people recommending this repository. And there is a good reason for this: &lt;strong&gt;the repository is their entire product!&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"That being said, this codebase isn't your typical open source project because it's not a library or package with a limited scope—it's our entire product."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In my opinion, this is one of the best open source full-stack react projects that shows off how to properly structure a large codebase&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vTPze4OD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/08/Screen-Shot-2020-08-07-at-20.41.11.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vTPze4OD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/08/Screen-Shot-2020-08-07-at-20.41.11.png" alt="Full-Stack JS in action"&gt;&lt;/a&gt;Spectrum folder structure: Full-stack JavaScript in action&lt;/p&gt;

&lt;p&gt;The frontend SPA (react) lives in &lt;code&gt;src&lt;/code&gt; folder&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0Yr9B1LG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/08/Screen-Shot-2020-08-07-at-20.53.35.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0Yr9B1LG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/08/Screen-Shot-2020-08-07-at-20.53.35.png" alt="List of Open Source React projects on GitHub to learn from"&gt;&lt;/a&gt;SPA frontend folder structure&lt;/p&gt;

&lt;p&gt;As you can infer from the folder structure, they split the code by "type" of code (components, reducers, hooks, etc).&lt;/p&gt;

&lt;h2&gt;
  
  
  9) GitHub profile README Generator – &lt;a href="https://rahuldkjain.github.io/gh-profile-readme-generator/"&gt;Live&lt;/a&gt; | &lt;a href="https://github.com/rahuldkjain/github-profile-readme-generator"&gt;Repo&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;This tool provides an easy way to create GitHub profile README with the latest add-ons like visitors count, GitHub stats etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bM3I659e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/github-profile-readme-generator.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bM3I659e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/github-profile-readme-generator.gif" alt="Project Demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is an example of a &lt;a href="https://www.gatsbyjs.com/"&gt;Gatsby&lt;/a&gt; project that uses hooks. The files are organized by type which is fine for the size of the project:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xvc7DCMs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/Screen-Shot-2020-09-04-at-15.52.11.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xvc7DCMs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codewithnico.com/content/images/2020/09/Screen-Shot-2020-09-04-at-15.52.11.png" alt="Code organization"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you haven't created your GitHub profile, maybe you can now by using this tool (&lt;a href="https://github.com/muzk/"&gt;I did!&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  Did I miss a project?
&lt;/h2&gt;

&lt;p&gt;It was a bit hard to find open-source projects using the latest react tools (e.g. hooks) 😓. &lt;/p&gt;

&lt;p&gt;Reply in the comments if you think I miss a cool modern project 😊&lt;/p&gt;

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