r/javascript • • Apr 02 '19

Dan Abramov teaches me React Hooks

https://www.twitch.tv/videos/404530952
578 Upvotes

24 comments sorted by

31

u/marty_byrd_ Apr 02 '19

I love fun fun function.

2

u/[deleted] Apr 02 '19

[removed] — view removed comment

3

u/ninetailsbr Apr 02 '19

I love both Dan and MPJ, they're awesome!

It's kinda a crossover lulz

18

u/bnelo12 Apr 02 '19

It's funny reading the Redux documentation now a days. He put in a comment about how he no longer supports the idea of using container components and instead to use React hooks.

18

u/germainelol Apr 02 '19

It makes sense, but I still enjoy making container components purely so that I have some pure UI components that are reusable and can be shown easily in Storybook.

8

u/MaggoLive Apr 02 '19

This exactly! If possible try to avoid state and data access as much as possible in your components and only use it at the top level. Keep em pure!

5

u/vuesrc Apr 02 '19

Have you got any citations on this?

6

u/[deleted] Apr 02 '19

https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0 not exactly what op means , think he mixed it up

1

u/bnelo12 Apr 02 '19

I'm not sure. I remember seeing a link to this article in the Redux docs but I can't seem to find it now. It might of been removed.

8

u/0xF013 Apr 02 '19

I have these bookmarked when I have to argue against containers on a new job:
https://twitter.com/dan_abramov/status/668585589609005056
https://twitter.com/dan_abramov/status/802569801906475008

9

u/pgrizzay Apr 02 '19

DADD

Dan Abramov Driven Development

1

u/[deleted] Apr 02 '19

Apparently it’s in the comments of Redux

2

u/lilred181 Apr 02 '19

You have a source for this? I still use container components with the latest React so I'd be curious if I shouldn't be anymore.. still feel like I need "Redux Container components" but not container components for React local state anymore because of hooks.

13

u/anyfactor Apr 02 '19

Good Monday morning!!

4

u/jcksnps4 Apr 02 '19

Is it worth sitting through two hours of it though?

3

u/ackxhpaez Apr 03 '19

You can wait for the edited version on YouTube. The stream is better to watch live because it's interactive.

3

u/Aswole Apr 03 '19

Not really. It's an hour of setting up screen-share + chatting, and then another hour converting a tutorial codebase with classes into functional components with useState (which is probably the easiest hook to grasp).

2

u/hogyster Apr 02 '19

tat's cool

1

u/[deleted] Apr 02 '19

Lol there are some gems in this video that hit close to home pair programming in my last position.

1

u/[deleted] Apr 02 '19

MPJ and Dan. Awesome. Thanks for sharing :)

-1

u/PickledPokute Apr 02 '19

One hour just barely scratched the surface. Anyone could've taken Dan's place for such a shallow scratch.

2

u/rararaaaaaaa Apr 02 '19

I haven't seen anyone do this, so it's a good thing we have Dan.

-5

u/rg25 Apr 03 '19

So sick of all these people.