Re:RawJS is a better way to call document.createElement()
by whstl on Thursday January 04, 2024 @05:57AM
(#38865550)
Off topic and unrelated to the discussion proper, but:
I really wish React had gone with "component factories" instead of `import ... from 'react'`.
This would not only allow for framework-agnostic components (so they could also work in Preact, Mithril, Inferno, etc, etc), it would also make the hooks implementation not dependent on global state.
I really wish React had gone with "component factories" instead of `import ... from 'react'`.
This would not only allow for framework-agnostic components (so they could also work in Preact, Mithril, Inferno, etc, etc), it would also make the hooks implementation not dependent on global state.
For example:
Then you would only have to import from React from the entry point.