Skip to content

[🐞] component not refresh when signal update #8007

@wszgrcy

Description

@wszgrcy

Which component is affected?

Qwik Runtime

Describe the bug

I want to use an asynchronous operation to update the signal (similar to setTimeout). However, when updating the value, printing the value is also normal But the rendering is not updated

Reproduction

https://github.com/piying-org/qwik-test

Steps to reproduce

npm i
npm run test.unit

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (16) x64 AMD Ryzen 7 8845HS w/ Radeon 780M Graphics
    Memory: 6.20 GB / 15.69 GB
  Binaries:
    Node: 22.17.0 - ~\AppData\Local\fnm_multishells\15868_1759077378864\node.EXE
    npm: 10.9.2 - ~\AppData\Local\fnm_multishells\15868_1759077378864\npm.CMD
  Browsers:
    Edge: Chromium (140.0.3485.66)
    Internet Explorer: 11.0.19041.3636
  npmPackages:
    @builder.io/qwik: 1.16.1 => 1.16.1
    typescript: 5.4.5 => 5.4.5
    undici: * => 7.16.0
    vite: 7.1.4 => 7.1.4

Additional Information

Image
export function useTest(fn1: () => any) {
  let a = useSignal(0);
  setTimeout(() => {
    a.value = fn1();
    console.log(a.value);
  }, 100);
  return a;
}
export const ExampleTest = component$((props: { flag: boolean }) => {
  let a = useTest(noSerialize(() => '123456')!);
  return (
    <>
      <div>{a.value}</div>
    </>
  );
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions