Re:Nue: A React/Vue/Vite/Astro Alternative
by root_axis on Friday September 15, 2023 @10:59AM
(#37524072)
"use" is just a convention for hook function names, react doesn't require or enforce it.
[ Parent
| on HN ]
Re:Nue: A React/Vue/Vite/Astro Alternative
by iainmerrick on Friday September 15, 2023 @11:36AM
(#37524651)
It's "just" a convention, but a strongly encouraged one. The React docs say:
Its name should always start with `use` so that you can tell at a glance that the rules of Hooks apply to it.
And it is required and enforced if you use the ESLint react-hooks plugin (which I'm guessing most large projects do).