-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use inline elements directly instead of createElement #152
Comments
This would also let us remove the dynamic variants of elements. |
Sounds good to me! |
I tried this out and it seemed to work alright, but if I mixed this with normal |
Unfortunately, I don't think this is tractable. React does all sorts of crazy stuff in dev mode to secretly track validation, which means you'll get all sorts of strange warnings since the correct secret flags aren't in the correct secret place. |
Thanks for giving this a go. Based on your findings, it sounds like it is probably best to leave this out for now. |
I think you could maybe createElement at startup and poke it to see if it has dev-mode validation flags, and conditionally add them. But I think I'd rather experiment with that at scale to see what kind of drawbacks it has. It's fine for production mode, but I'm not sure if it would make development confusing. |
Here is my branch with the appropriate switch if anyone wants to mess with it. https://github.com/natefaubion/purescript-react/tree/inline-elements |
Thanks! |
https://babeljs.io/docs/plugins/transform-react-inline-elements/
This would let us get around issues with
createElement
's API (which mixes in key and ref with the normal props), and avoid the headaches with the attempt inmaster
at typingcreateElement
.The text was updated successfully, but these errors were encountered: