@kentcdodds Hi, I've enrolled in your Epic React course and I'm in React Hooks Section now. May I ask a question on Exercise2(Use Effect)?
In the beginning of the video, you've said "Every application eventually needs to do something to the outside world. We don't want to do that directly in the render function or this function for our function components"
What I'd like to ask you is (1) Why do we want to avoid side effect operation in a component? (2) Before useEffect is available to use in React, what was the appropriate place and way to do side effect operation? (redux's action dispatch???)
(3) In the final code that is attached to the first tweet in this thread, you are accessing data in local storage and pass it to useState argument. isn't accessing local storage by get method side effect operation as well, right? why is it okay to do that in the component?
You can follow @ShuIkegami.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: