Re:JavaScript: The Modern Parts
by csande17 on Saturday August 24, 2019 @01:54PM
(#20788587)
Indeed, hooks are pretty much the furthest thing from functional programming there is. In functional programming, functions can safely be called any number of times from anywhere in the program, and they'll always return the same result for the same arguments.
Hooks, on the other hand, crash and burn at runtime if you call them outside a React component function, or in a different order or number from how you called them the first time your component was rendered.
Hooks, on the other hand, crash and burn at runtime if you call them outside a React component function, or in a different order or number from how you called them the first time your component was rendered.