Comment

Comment by danabramov

While HN wasn’t convinced last time I posted this, here’s a few posts or sections that explain the static call order thing:

https://overreacted.io/why-do-hooks-rely-on-call-order/

https://overreacted.io/react-as-a-ui-runtime/#static-use-ord...

https://github.com/reactjs/rfcs/pull/68#issuecomment-4393148... (Persistent Call Index section)

Hope this helps, happy to answer questions. We’ve been using Hooks for several months at FB and haven’t seen confusion caused by the call order reliance.

(Note Hooks don’t rely on specific call order but just on it being static between renders. Which is pretty easy to understand and reasonably enforce in practice.)

parent danabramov 7 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton