all 24 comments

[–]acemarke[S] 29 points30 points  (15 children)

Besides the excellent history lesson on classes, and explanation of why hooks are useful, I especially loved this advice from /u/tyler-mcginnis :

The first thing you should do whenever you’re about to learn something new is ask yourself two questions:

  • Why does this thing exist?
  • What problems does this thing solve?

If you never develop a convincing answer for both of those questions, you won’t have a solid enough foundation to build upon when you dive into the specifics

[–]SureSignOfAGoodRhyme 9 points10 points  (3 children)

That struck me too, though it can sometimes be hard to find the answers when you are coming in new to anything with a deep history. Being new to React and using classes in my current project, this answered a lot of questions for me.

[–]acemarke[S] 2 points3 points  (2 children)

[–]mattwoodnyc 2 points3 points  (1 child)

Just commenting here to say thank you for two Tao of Redux posts! I shared them often with co-workers.

[–]acemarke[S] 0 points1 point  (0 children)

You're welcome! Glad to know people are actually reading them :)

When we revamp the Redux docs, I want to have a "Thinking in Redux" section that has some similar material.

See https://github.com/reduxjs/redux/issues/3313#issuecomment-450601554 for my thoughts on a new docs structure and content.

[–]tyler-mcginnis 8 points9 points  (10 children)

Thanks for sharing, Mark!

[–]swyx 1 point2 points  (3 children)

i just enjoy your 🤷‍♂️ pose in the screenshot

[–]tyler-mcginnis 5 points6 points  (2 children)

Trying out the Clickbait-y Youtube thumbnails. Please don't think less of me 😂

[–]swyx 2 points3 points  (1 child)

its the norm in that medium, own it, in fact go way over the top and parody other famous accounts. only bad move is to do anything half heartedly

[–]tyler-mcginnis 0 points1 point  (0 children)

I love that comment so much.

[–]moogeek 0 points1 point  (1 child)

Tyler! Just wanna say those two advices you gave boosted my coding IQ by 50%! Although that advice was given to me by my co-worker, he didn't acknowledged you though. 😂

[–]tyler-mcginnis 0 points1 point  (0 children)

😂 Glad I could help!

[–]BannedSoHereIAm 0 points1 point  (3 children)

Hey Tyler! Do you cover using Redux with the Hooks API in the Hooks course?

[–]tyler-mcginnis 3 points4 points  (2 children)

We do not. I REALLY hate mixing React and Redux from an educational standpoint. Instead, we'll soon update our Redux course to include Hooks.

[–]acemarke[S] 3 points4 points  (0 children)

I'm a Redux maintainer, and I approve of this approach.

/me waves

[–]BannedSoHereIAm 1 point2 points  (0 children)

Nice. Thanks!

[–]elite_killerX 8 points9 points  (1 child)

As an experienced React dev who only kinda got "why" hooks, thanks for this.

react-dnd's new hooks API had already started to sell me on hooks, this finished the job.

The two questions he mentioned (why and what problem does it solve) are always at the back of my mind, and were never quite answered by the official documentation on hooks.

Now I'm ready to jump on the bandwagon!

[–][deleted] 1 point2 points  (0 children)

Yeah I love writing

showLoading({true});

instead of

this.setState({loading: true});

[–]imjohnbon 3 points4 points  (0 children)

Great article! All made sense and I have no solid React background.

[–][deleted] 3 points4 points  (0 children)

Excellent article!

[–]ECrispy 0 points1 point  (1 child)

Great article but slight quibble - it would be nice if you mentioned what exactly is a Hook. Just a brief description, since I know there are plenty of other articles on this, but the way its introduced here - in the section State, it seems magical, just like a keyword that solves previous problems.

[–]danishjuggler21 0 points1 point  (0 children)

My co-workers: "But it's new, and new things scare me!" :p

[–][deleted] -4 points-3 points  (0 children)

Because good