3 ms·
> IMO, React really could have benefited from devoted language syntax for this (like Svelte does) to automagically and statically track all the dependencies. Bu
by maxwellburson 5y ago
> IMO, React really could have benefited from devoted language syntax for this (like Svelte does) to automagically and statically track all the dependencies. But React has an ethos of being "just JavaScript" (even JSX desugars to relatively straightforward React.createElement calls, and you can treat those nodes like regular JS objects, pass them around willy nilly, etc.), so it didn't happen (and instead we have lint rules like ESLint rules-of-hooks that are designed to enforce the invariants that really the programming language should enforce).
You’re looking for solid.js
https://www.solidjs.com/ https://www.solidjs.com/
It’s “just JavaScript” like React, but with automatic dependency tracking. My understanding is that React hooks are the best React can do given backwards compatibility requirements. Reacts beast feature is it’s ecosystem.