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)

Collapse
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.

Collapse
juniusfree profile image
juniusfree

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.

Collapse
kayis profile image
K (he/him)

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

Collapse
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.

Collapse
simoroshka profile image
Anna Simoroshka

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

👀 Just want to lurk?

 
That's fine, you can still create an account and turn on features like 🌚 dark mode.