i.e. h('input') where you don't specify the value for the input and allow that state to live in the DOM as a mutable value.
This may cause subtle bugs like a virtual-dom diff / patch cycle not resetting the value to the empty string because it was left transient.
This is either a "feature" or a "bug".
One solution is to have mercury throw an exception if the user "accidentally" uses transient state and to make transient state opt in with something like h('input', { value: h.TRANSIENT })
The subtleties here seem like it would be better to have mercury throw in this case. I think most who get into this situation would probably get there on accident...
Currently mercury allows transient state.
i.e.
h('input')
where you don't specify thevalue
for the input and allow that state to live in the DOM as a mutable value.This may cause subtle bugs like a virtual-dom diff / patch cycle not resetting the value to the empty string because it was left transient.
This is either a "feature" or a "bug".
One solution is to have mercury throw an exception if the user "accidentally" uses transient state and to make transient state opt in with something like
h('input', { value: h.TRANSIENT })