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

fix(jsx/dom): should not return memoized result when context is changed #3792

Merged
merged 1 commit into from
Jan 1, 2025

Conversation

usualoma
Copy link
Member

fixes #3778

In v4.5 and later versions, nested function components were over-cached and not re-rendered even when the context was updated. This PR will fix this bug.

The author should do the following, if applicable

  • Add tests
  • Run tests
  • bun run format:fix && bun run lint:fix to format the code

Copy link

codecov bot commented Dec 31, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 91.70%. Comparing base (1e62912) to head (53e15ce).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/jsx/dom/render.ts 83.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3792      +/-   ##
==========================================
- Coverage   91.71%   91.70%   -0.02%     
==========================================
  Files         160      160              
  Lines       10181    10192      +11     
  Branches     2896     2856      -40     
==========================================
+ Hits         9338     9347       +9     
- Misses        842      844       +2     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@usualoma usualoma changed the title fix: should not return memoized result when context is not changed fix: should not return memoized result when context is changed Dec 31, 2024
@usualoma
Copy link
Member Author

@yusukebe
Happy New Year! I hope that this year will be a good one for Hono.

@yusukebe yusukebe changed the title fix: should not return memoized result when context is changed fix(jsx/dom): should not return memoized result when context is changed Jan 1, 2025
Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yusukebe
Copy link
Member

yusukebe commented Jan 1, 2025

Hey @usualoma

Happy New Year! 🎍 It should be a good year! Looks good. Merging.

@yusukebe yusukebe merged commit fa6f51b into honojs:main Jan 1, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[jsx] Hydrated useContext does not receive new value from context with HonoX
2 participants