purescript-contrib/purescript-react

Setting className to custom tag fails

unclechu opened this issue · 3 comments

purescript-react is v5.1.0

When I declare my own tag name by this command:

createElementTagName "my-own-tag-name" [className "container"]

And then when its rendered I got this tag in DOM tree but without class attribute and I see this warning in log:

Warning: Invalid attribute name: `0`
warning.js:33

Maybe I misunderstood something? I just used

mkDOM (IsDynamic false) "my-own-tag-name" [class "container"]

instead and it works.

I think I get it, createElementTagName is free to put anything as props, so I put array when I supposed to put a record, am I right?

ethul commented

Yes, you're correct. The props would have to be a record in this case.