QwikDev / qwik

Instant-loading web apps, without effort
https://qwik.dev
MIT License
20.83k stars 1.31k forks source link

[🐞] `dangerouslySetInnerHTML` with signal values renders `[object Object]` instead of the signal value #3415

Closed jessezhang91 closed 1 year ago

jessezhang91 commented 1 year ago

Which component is affected?

Qwik Runtime

Describe the bug

I am setting the dangerouslySetInnerHTML property of a div to a signal's value.

What I expect is the div to render the raw HTML contained in the signal.

What actually is happening is the string [object Object] is being rendered instead.

Reproduction

https://stackblitz.com/edit/qwik-starter-b5qk8k?file=src%2Froutes%2Findex.tsx

Steps to reproduce

<div dangerouslySetInnerHTML={signal.value} />

System Info

System:
    OS: macOS 13.2.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 1.42 GB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.13.0 - ~/.nvm/versions/node/v18.13.0/bin/node
    npm: 8.19.3 - ~/.nvm/versions/node/v18.13.0/bin/npm
  Browsers:
    Chrome: 111.0.5563.64
    Firefox Developer Edition: 112.0
    Safari: 16.3
  npmPackages:
    @builder.io/qwik: 0.22.1 => 0.22.1
    @builder.io/qwik-city: 0.6.3 => 0.6.3
    undici: ^5.21.0 => 5.21.0
    vite: 4.2.0 => 4.2.0

Additional Information

No response

stackblitz[bot] commented 1 year ago

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.