React version: 18.2.0
Steps To Reproduce
- have a node with a nested structure that embeds state
- change that nodes innerHTML, e.g. by setting it empty
- update the state
- updated state does not restore DOM Nodes
Link to code example:
https://codesandbox.io/p/sandbox/react-webcomponents-69d8v8
The current behavior
DOM stays empty, i.e. rerenders have no effect
The expected behavior
DOM should be re-populated, i.e. react should take control again.
Context
I can kind of understand why react "breaks" but the issue here is that by e.g. using webcomponents that integrate with forms and implement a "reset" behaviour the applied solution will most likely involve some kind of innerHTML setting. I wish react wouldn't just "give up" in such cases. Is there a workaround possible here?
React version: 18.2.0
Steps To Reproduce
Link to code example:
https://codesandbox.io/p/sandbox/react-webcomponents-69d8v8
The current behavior
DOM stays empty, i.e. rerenders have no effect
The expected behavior
DOM should be re-populated, i.e. react should take control again.
Context
I can kind of understand why react "breaks" but the issue here is that by e.g. using webcomponents that integrate with forms and implement a "reset" behaviour the applied solution will most likely involve some kind of innerHTML setting. I wish react wouldn't just "give up" in such cases. Is there a workaround possible here?