Skip to content

Using signal doesn't let the state change at the parent component level #4747

Closed
@murtuzasyed

Description

@murtuzasyed
  • Check if updating to the latest Preact version resolves the issue

Describe the bug
I have a simple Component(TestComponent.jsx) that has a single state 'loading' that changes after an async action. If I have a signal in a child component, the loading state change doesn't trigger a new render.

To Reproduce
Issue can be reproduced here https://stackblitz.com/edit/create-preact-starter-dbmgvvks?file=src%2FTestChild.jsx

Steps to reproduce the behavior:

  1. Go to the link
  2. The UI gets stuck at Loading...

Expected behavior
The Loading... text gets replaced with the contents of the chid component TestChild. If I remove the below line from TestChild component it works fine.

import { signal, computed } from '@preact/signals'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions