Re:Introducing Hooks
by adriancooney on Thursday October 25, 2018 @04:37PM
(#18304378)
I doubt the linter will enforce the same-ordering, that would require state between runs. I think the linter just ensures hooks are run at the top level in the functional component.
[ Parent
| on HN ]
Re:Introducing Hooks
by atomwaffel on Friday October 26, 2018 @04:34PM
(#18312517)
And it wouldn't need to. You're free to move around calls to useState() to your heart's content in your code, you just need to call them in the same order during the lifecycle of your component.