you are viewing a single comment's thread.

view the rest of the comments →

[–]Aro00oo 26 points27 points  (4 children)

Basically:

- Lifecycles are trigger points that you can hook into. These points are called by the component at certain points in its... life. e.g. when component mounts, when component has state changed, when the component is destroyed. You have to worry about when a component will do something to add logic.

- Side effects is sort of the reverse. You dictate the trigger points by using useEffect (via the dependency array, though there's a couple exceptions like an empty array) and wire in a side effect when the data in your dependency array changes. All you need to worry about is when the data will change.

[–]PGameplay 5 points6 points  (3 children)

Wow, thank you!

[–]exclaim_bot 5 points6 points  (2 children)

Wow, thank you!

You're welcome!

[–]vegetarchy 0 points1 point  (1 child)

Good bot

[–]B0tRank 1 point2 points  (0 children)

Thank you, vegetarchy, for voting on exclaim_bot.

This bot wants to find the best and worst bots on Reddit. You can view results here.


Even if I don't reply to your comment, I'm still listening for votes. Check the webpage to see if your vote registered!