Skip to content

[🐞] [v2] Inconsistent behaviour of props and signals #7986

@sergeche

Description

@sergeche

Which component is affected?

Qwik Runtime

Describe the bug

We’re using Qwik 2 beta 10 for building our app and stumbled with the following issue (see repro link).
If we pass image prop of <ResponsiveImage> component as generateImage(props.data) expression, none of useTask or useComputed of ResponsiveImage are updated (computed is updated only once when client-side components are loaded). But if we pass image as computed signal, everything works as expected. After debugging, I found out that task callback of useTask expects a signal to be read to create effect subscription, and props itself is not considered as reactive symbol.

However, running the same code with expression in image on Qwik 1 produces different result: in ResponsiveImage component useComputed works as expected, useTask callback is invoked (see console logs) but fullImage signal contents is not re-rendered in browser. Switching image to computed signal works as expected.

Considering that we’re on Qwik 2, is this behaviour expected and we should always use computed symbols for such cases?

Reproduction

https://github.com/sergeche/qwik-demo-v2/blob/main/src/routes/assets/index.tsx#L30

Steps to reproduce

Run this route example as usually in dev mode and click on Generate button a few times. Both strings with /path/to and /computed/path/to should have the same file name, which is unique on every button click

System Info

System:
    OS: macOS 15.6.1
    CPU: (10) arm64 Apple M4
    Memory: 147.17 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
Binaries:
    Node: 22.16.0 - /usr/local/bin/node
    npm: 10.9.2 - /usr/local/bin/npm
    bun: 1.2.15 - ~/.bun/bin/bun
Browsers:
    Chrome: 140.0.7339.133
    Safari: 18.6
npmPackages:
    typescript: 5.8.3 => 5.8.3 
    vite: 7.0.0 => 7.0.0

Additional Information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions