r/javascript • u/krasimirtsonev • Apr 02 '19
Dan Abramov teaches me React Hooks
https://www.twitch.tv/videos/40453095218
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
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/8025698019064750089
1
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
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
1
Apr 02 '19
Lol there are some gems in this video that hit close to home pair programming in my last position.
1
-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
-5
31
u/marty_byrd_ Apr 02 '19
I love fun fun function.