Closed kostasmanionis closed 8 years ago
Thanks for the PR, looks good.
I kinda lowballed on tests here, but I don't think there's much more to test here.
Few things I'd like to point out:
We're gonna be transforming all the event handler attributes <div onclick="doSomething();">Click me!</div>
but it won't work since react only accepts functions.
And we're gonna be transforming svg attributes on non svg elements. Not sure if this is a problem though.
On review, I'm not keen on having the event handlers in here, as that will never work in any HTML you're copying and pasting anyway.
I'm wondering if it would be cleaner to take the SVG props and spin them out into a new babel-plugin-react-svg-attrs
.
So I've removed every onWhatever
attribute from the list.
Also removed svg attributes. I'm cool with spinning of svg to a separate pacakge, we could also make a preset for people who want to use both.
Nice, thanks.
Thinking the best option is probably to make this plugin configurable after dealing with #3.
This should resolve https://github.com/insin/babel-plugin-react-html-attrs/issues/1 + transform SVG attributes.
I kinda figured it would be nice if this also transformed SVG attributes. We're using this for building react SVG components.