-
Notifications
You must be signed in to change notification settings - Fork 16
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
Only munge props when converting to native React elements #40
Conversation
I just tried this out with some react-bootstrap components we are using, and it's slightly broken... It seems like this change doesn't handle converting So for example:
yields the warning
|
That sounds correct - I removed all of the props conversions for Components as elements. For interop purposes it would probably be good to keep around |
From a quick glance at the React reference (and at the existing source code), it seems like There's a bunch of others too, but I don't think we need to worry about them. There's also the case of fully custom attributes, which React expects to be full lowercase (e.g. |
3fa7a8f
to
7af0233
Compare
I have added conversion of |
This PR changes the way that
hx.hiccup
converts props when parsing hiccup, so that it will only do camel->kebab and other munging if the element being passed the props is a keyword (e.g.:div
,:span
).It also changes the way
hx.react/defnc
parses the props object, so that it will not do camel->kebab and other munging.The following code exemplifies the new behavior:
:class
is special-cased to be made available as:class-name
for backwards compatibility reasons.