helix 2021-05-06

hmm that's tricky

in helix, you would do this like:

($ "brick-flipbox" {:class "demo"}
  (d/div "front")
  (d/div "back"))

$ detects that the component type you passed in is a string, and will do DOM-specific transformations... like converting class to className 😞

this behavior will actually go away soon, as in the last version I introduced a react-dom specific helix.dom/$d which you can call explicitly to do that transformation

since in a lot of contexts, those transformations are invalid - e.g. in web components 😅, react native, and other renderers

you could write your own $wc using the same tools that $d uses to e.g. opt out of the class->className conversion

👍 1