Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jsx] Hydrated useContext does not receive new value from context with HonoX #3778

Closed
berlysia opened this issue Dec 27, 2024 · 1 comment · Fixed by #3792
Closed

[jsx] Hydrated useContext does not receive new value from context with HonoX #3778

berlysia opened this issue Dec 27, 2024 · 1 comment · Fixed by #3792
Labels

Comments

@berlysia
Copy link
Contributor

berlysia commented Dec 27, 2024

What version of Hono are you using?

4.6.14

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

Bun, but it's probably runtime independent

What steps can reproduce the bug?

  1. Use create-hono and choose x-basic
  2. Prepare provider and consumer as island components
    • Define the value passed by the context containing a value and an updater function, similar to the return value of useState.
  3. Interact with rendered page

What is the expected behavior?

When the value passed to the Provider is updated, the value received by its descendant useContext will be in an updated state.

What do you see instead?

When the value passed to the Provider is updated, the value received by its descendant useContext will remain the same as the first.

Additional information

It does not occur with Hono 4.4, but occurs with Hono 4.5.0-rc.2 or later.
Occurs only when using with HonoX, but depends on the Hono version, so write here.
repro: https://berlysia.github.io/hono-jsx-context-hydration-issue/

I also tried with React renderer, it works as expected

@usualoma
Copy link
Member

Hi @berlysia, Thanks for the report. I'll investigate!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants