Mutating element onMount doesn't re-render
I am trying to mutate the innerText (or innerHTML) of a <div /> in an async function that I dispatch onMount().
This is in SSR mode, so maybe that's relevant here, but I did confirm that onMount is running in the browser only.
1. I tried holding a ref "refDiv", then mutating innerText, but that doesn't seem to mutate the DOM. Are refs copies or actual references to the DOM element? Is there a better way to approach this?
2. I also tried holding a signal "innerText" and setting that in the load function. That didn't work either, which confused me even more.
3. Mutating DOM directly did work, so the ref's tagName is at least correct.
Here is repro code for the things I've tried:
This is in SSR mode, so maybe that's relevant here, but I did confirm that onMount is running in the browser only.
1. I tried holding a ref "refDiv", then mutating innerText, but that doesn't seem to mutate the DOM. Are refs copies or actual references to the DOM element? Is there a better way to approach this?
2. I also tried holding a signal "innerText" and setting that in the load function. That didn't work either, which confused me even more.
3. Mutating DOM directly did work, so the ref's tagName is at least correct.
Here is repro code for the things I've tried:
