Open zcallan opened 6 years ago
I'll note that you can get around this by creating a component for createElement
, like below:
const CreateElement = ({ element, children, ...restProps }) => {
return React.createElement( element, restProps, children );
};
...
render() {
return (
<CreateElement
element="h1"
styleName="example-style
/>
);
}
However that's not super ideal.
There is currently no support for using
createElement
andcloneElement
with thestyleName
attribute (as far as I've tried), which at times can be a bit painful.-->
I haven't read through the source code but t would assume it is a transform thing, where the
styleName
prop is not read as it's not a JSX prop but rather a passed in as an object. JSX gets transformed intocreateElement
s so I would've guessed that this would work automatically but I guess not, unless I'm doing something wrong here.Wondering if there's any ability for future support?