Closed chiefcll closed 3 months ago
Hmm.. we don't have the option right now as it is pretty specific. In the DOM we are used to everything being strings so we get away with it and JSX passes it straight through like that so we don't need any sort of special processing. It would also need to be handled on the spread side at runtime since we don't see all the attributes coming in that way. I could see how an option like this could be made/work just unsure about edge cases and it making sense.
Just figured I'd ask. Ideally I'd want it done during build for less processing client side. I could have something custom in Vite to look for certain properties and switch them.
I have a universal renderer where I can do something like:
And that works great and all the attributes are numbers.
However if a user does this:
It's valid but all the types come in as strings.
Question: Can I specify certain attributes to be treated as Numbers during compilation?