2 ms·
Indeed, hooks are pretty much the furthest thing from functional programming there is. In functional programming, functions can safely be called any number of t
by csande17 7y ago
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.