r/learnreactjs • u/csaccnt • Nov 04 '19
I made an intro to React Hooks Pt. 1: useState (Re-creating a class component)
https://www.youtube.com/watch?v=fNF2PMB5GW0
11
Upvotes
1
u/botmentor Nov 05 '19
nice video. What's use case of expensiveCalc to be run only once by passing the callback ?
2
u/csaccnt Nov 05 '19
Thanks! It's probably not something you'd run into often, but if you have a function whose return you want to set to state, and that function has a chance to pose any sort of delay, pass it as a callback.
1
u/merunas Nov 04 '19
Great video my dude. The video quality is on point keep making these tutorials