-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
chore(react-utilities): useControllableState warns if controlled and uncontrolled at the same time #31461
Merged
bsunderhus
merged 3 commits into
microsoft:master
from
bsunderhus:react-utilities/chore--useControllableState-errors-if-controlled-and-uncontrolled
Jun 4, 2024
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
FluentProviderWithTheme | virtual-rerender-with-unmount | 77 | 75 | 10 | Possible regression |
All results
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
Avatar | mount | 622 | 629 | 5000 | |
Button | mount | 301 | 306 | 5000 | |
Field | mount | 1137 | 1143 | 5000 | |
FluentProvider | mount | 708 | 707 | 5000 | |
FluentProviderWithTheme | mount | 85 | 87 | 10 | |
FluentProviderWithTheme | virtual-rerender | 32 | 36 | 10 | |
FluentProviderWithTheme | virtual-rerender-with-unmount | 77 | 75 | 10 | Possible regression |
MakeStyles | mount | 873 | 877 | 50000 | |
Persona | mount | 1771 | 1708 | 5000 | |
SpinButton | mount | 1352 | 1425 | 5000 | |
SwatchPicker | mount | 1579 | 1569 | 5000 |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
📊 Bundle size reportUnchanged fixtures
|
fabricteam
reviewed
May 23, 2024
change/@fluentui-react-utilities-7d570c9e-82bf-48fd-84c2-7e660f079e19.json
Show resolved
Hide resolved
bsunderhus
requested review from
sopranopillow,
a team,
smhigley and
micahgodbolt
as code owners
May 24, 2024 09:43
bsunderhus
force-pushed
the
react-utilities/chore--useControllableState-errors-if-controlled-and-uncontrolled
branch
from
May 24, 2024 10:03
4a48123
to
052dc19
Compare
…uncontrolled at the same time
…seControllableState hook invocation
bsunderhus
force-pushed
the
react-utilities/chore--useControllableState-errors-if-controlled-and-uncontrolled
branch
from
May 24, 2024 11:49
052dc19
to
fbacd9a
Compare
ling1726
approved these changes
May 27, 2024
smhigley
approved these changes
Jun 4, 2024
bsunderhus
deleted the
react-utilities/chore--useControllableState-errors-if-controlled-and-uncontrolled
branch
June 4, 2024 19:29
miroslavstastny
pushed a commit
to miroslavstastny/fluentui
that referenced
this pull request
Jun 14, 2024
…uncontrolled at the same time (microsoft#31461)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previous Behavior
Using both controlled and uncontrolled state on
useControllableState
hook would default to the state value, which is expected.In native react elements (such as
input
) if the user provides both controlledvalue
and uncontrolleddefaultValue
an error will be displayed in the console:The element works as expected, the controlled value takes precedence, but the warning is emitted as extra information to avoid confusion from the user side (as something might be going wrong if the user is providing both)
New Behavior
react-utilities
tests to count for the console.errorreact-accordion
react-calendar-compat
react-list-preview
react-search
react-slider
react-tree
Related Issue(s)
defaultOpenItems
andopenItems
#31445