3 ms·
I don't think that's true, you can write uncompiled createElement calls and everything still works fine.
by samdoesnothing 11mo ago
I don't think that's true, you can write uncompiled createElement calls and everything still works fine.
- csande17 11mo agocreateElement still exists, but the JSX compiler doesn't use it anymore; see https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html https://legacy.reactjs.org/blog/2020/09/22/introducing-the-n... Regardless of whether you use JSX or createElement, you can't just call MyComponent({ attr: “yes” }) directly, is the main point.
- christophilus 11mo agoYou certainly can in Preact.
- samdoesnothing 11mo agoYeah I don't think you ever could just call MyComponent(props) directly if the component used hooks. If it was hookless (what a concept...) it wouldn't matter.