https://reactjs.org/docs/web-components.html#using-web-components-in-react > One common confusion is that Web Components use “class” instead of “className”. Does helix handle this, or do I have to do some funk? Not actually using web components, just curious.
From the Helix docs, I found that if I passed the :class
prop into my components, it would automagically translate them to :className
https://github.com/lilactown/helix/blob/master/docs/creating-elements.md
See “Other special props:” subsection
In practice, it was working until I integrated with a library that clones an element or does some more complex interaction. Then, :class was not properly replaced to :className until a second render, and I just decided to use :className
as I’m anyways used to that on React (js) and don’t mind.
I suppose, to directly address your question: I don’t know if Helix transforms class
to className
in those scenarios (web components), or if it should.