DEV Community

Joshua Nelson ✨
Joshua Nelson ✨

Posted on

What were your "gotchas" when first learning React?

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?

Top comments (5)

juanfrank77 profile image
Juan F Gonzalez

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.

juniusfree1 profile image

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.

kayis profile image

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.

niorad profile image
Antonio Radovcic

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.

simoroshka profile image
Anna Simoroshka

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