fix: select defaultValue re-render issue#8816
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview This ensures consumers (e.g., tab/select wrappers) see the selected item update on re-render when the upstream default changes, instead of staying stuck on the initial render value. Reviewed by Cursor Bugbot for commit f15ebcd. Bugbot is set up for automated code reviews on this repo. Configure here. |
👋 Codeowner Review RequestThe following codeowners have been identified for the changed files: Team reviewers: @nodejs/nodejs-website Please review the changes when you have a chance. Thank you! 🙏 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8816 +/- ##
==========================================
- Coverage 74.27% 74.26% -0.01%
==========================================
Files 104 104
Lines 8847 8849 +2
Branches 328 328
==========================================
+ Hits 6571 6572 +1
- Misses 2274 2275 +1
Partials 2 2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Pull request overview
Restores Select’s ability to reflect changes to defaultValue after initial render (fixing cases like OS detection updating from LOADING to a concrete value).
Changes:
- Import
useEffectin theSelectcomponent. - Sync internal
valuestate wheneverdefaultValuechanges via auseEffect.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
I think we should avoid long PRs like #8672 in the future, cause they're hard to review and easy to let simply things like this pass |
|
@nodejs/nodejs-website asking fast-track |
ovflowd
left a comment
There was a problem hiding this comment.
SGTM! Does this fix all the issues we saw on the deployment?
It resolved the issues I was experiencing 👀 (Unknown value, Automatic selection) |
I wonder if other pages are also broken :/ -- any other page you've noticed anything odd that was affected by the other PR (aka thar you've seen in the diff) |
|
@canerakdas ☝️ |
Based on my experience, I haven't encountered any other issues |
|
@nodejs/nodejs-website I'm fast-tracking this as a PRODUCTION hot-fix. |
Description
In our current
Selectcomponent, even if thedefaultValuechanges, it wasn't being reflected in the UI because the effect we were using had been removed in #8672. With this PR, we're adding that effect backValidation
OS default value would work on preview
Related Issues
Fixes: #8815
Check List
pnpm formatto ensure the code follows the style guide.pnpm testto check if all tests are passing.pnpm buildto check if the website builds without errors.