loading...

What were your "gotchas" when first learning React?

twitter logo github logo ・1 min read

I've found there are some common stumbling blocks that people have when they're learning React, and sometimes there's an "Aha!" moment when they understand.

  • The difference between ES2015, React, JSX
  • Complex usage of libraries like underscore or lodash in example code
  • Understanding the overall "data flow" of React (And, the "Flux" architecture as a concept)
  • Shared (but different!) concepts in other frameworks like Angular, Vue or even jQuery
  • The asynchronous nature of some operations (like setState)

Was there anything particularly tricky to get a handle on when you were learning React? What was your "Aha!" moment?

twitter logo DISCUSS (5)
markdown guide
 

I think the one thing so far that has been my most "Aha!" moment is the difference and usage of functional components vs class components. There's a lot writing out there that doesn't explain too much the nuances of it, but it all clicked when I read a post of Tyler McGinnis.

 

I'm currently building my first react app, a guess the number game. I'm not yet able to finish it because of the following:

  1. setState is asynchronous. I don't know how to use the states after the components update to update another state without going into the loop
  2. Using forms in react
  3. Handling events

These are the basic issues that I'm working on. I'm a newbie in webdev in general.

 

Your first two points where the reason I wrote React from Zero.

React got major popularity when ES2015 came out, so people didn't know what of all the new syntax was React specific.

github.com/kay-is/react-from-zero

 

Now that I think of it, it was probably the fact that React is really "just" the view. I was like "that's it?".
I did a little AngularJS before that, which is a bit more complex.

 

Data flow, data fetching, asynchronous state updates, some of lifecycle methods, routing.

Classic DEV Post from Oct 26 '18

How to make friends with Golang, Docker and GitLab CI

A simple way to build Golang apps with Docker in GitLab

Joshua Nelson ✨ profile image
👨‍💻 Developer @Atlassian, ❤️ The web, 🏢 Previously, also @Atlassian

dev.to now has dark mode.

Go to the "misc" section of your settings and select night theme ❤️