Skip to content

hono/jsx useState State Mixing in Nested Components #4661

@hashrock

Description

@hashrock

What version of Hono are you using?

4.11.7

What runtime/platform is your app running on? (with version if possible)

Node 22.21.1

What steps can reproduce the bug?

minimal repro:
https://github.com/hashrock-sandbox/issue-hono-20260204-usestate

  1. Create a project based on the hono-vite-jsx example.
  2. Build a component that has counter functionality: create one parent component and three child components.
  3. Click the parent component once.
  4. Click the second child component twice.
  5. Click the third child component once.
CleanShot.2026-02-04.at.11.30.07.mp4

What is the expected behavior?

  • Parent: 1
  • ChildA: 1
  • ChildB: 2

What do you see instead?

  • Parent: 1
  • ChildA: 2
  • ChildB: 1

Additional information

adding unique keys on child components doesn't solve this issue

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