-
Notifications
You must be signed in to change notification settings - Fork 53
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
JSX support? #51
Comments
Hello there @mindplay-dk !
Do you have some reference in mind? I modelled it (as close as it can get in 512 bytes) having react's Let me give it a try with JSX myself and I might have some more feedback for you ;) |
Oh I think I found the issue. JSX uses |
This should be on the list of caveats maybe? If supporting JSX is a non-goal, maybe this should be stated in the documentation as well? Many people will see the JSX-like I expect JSX-support is just a simple one-liner though - even if the library doesn't support it, perhaps an example wrapper-function could be added to the documentation? |
For now, totally, but I would also like to somehow support it... JSX was not my first priority so I never tested it to be honest... I based my initial API on React when I started, but due to the size constraints I decided to sacrifice some of the features. (Don't forget that the manifesto of this library is to never exceed the 512 bytes in size 🙂) |
The |
Wow. This just works?! With one line of code?! 😂 https://codesandbox.io/s/jsx-with-dot-dom-jjdzy Props, state, state-updates, updates to a parent component, everything just works. That's CRAZY cool. I think maybe now you can put this JSX one-liner in the docs and show off JSX support? 😀 |
Technically you should be able to do just
|
Apparently, yep. (I don't recall why I thought a function was necessary before...) |
Okay, so I recall now, #31 for one is something I wanted to address - as well as support for other literals like So I would maybe hold off on announcing JSX support, as it's probably going to be a bit too confusing for someone to use in practice right now. |
Any chance for JSX support?
I tried adding a JSX-compatible wrapper-function myself, but so far just found new and interesting ways to make the
H
function explode ;-)This got me some of the way, but doesn't work for text nodes yet...
Any particular reason the
H
function signature doesn't resemble a "normal" virtual DOM factory function?The text was updated successfully, but these errors were encountered: