dot-dom
dot-dom copied to clipboard
Does not handle children that are numbers
Does not nicely handle vnode instances which are numbers, only strings. Maybe if type number => render to string.
Ouch, that's indeed a tricky one. I will try to find a good solution for this, but right now it's not easy, since I am relying on string's properties to identify it.
Imo that's not a big limitation. I think it's fair to assume that numbers need to be casted to strings by components. The same problem also exists for null
and false
which are valid render values in React. Both the null
and the false
case can be expressed as ""
which I think is fine.
For the record, we're talking about these lines here, right?
I'm wondering, can we simply reverse the test and the condition?
So instead of vnode.replace
, how about e.g. !!vnode.a
?
This should match anything that's not a vnode object, including strings, numbers and booleans, right?
(if that works, also maybe swap the terminals of the ternary expression and save one of the !
operators.)
I think we can close this?
...although it's still on a devel branch that might should be merged back to master?