-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat: defers useControllableState state to initializer method #27717
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
feat: defers useControllableState state to initializer method #27717
Conversation
📊 Bundle size reportUnchanged fixtures
|
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 697 | 704 | 5000 | |
| Button | mount | 372 | 369 | 5000 | |
| Field | mount | 1257 | 1259 | 5000 | |
| FluentProvider | mount | 886 | 887 | 5000 | |
| FluentProviderWithTheme | mount | 107 | 114 | 10 | |
| FluentProviderWithTheme | virtual-rerender | 94 | 90 | 10 | |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 98 | 110 | 10 | |
| InfoButton | mount | 16 | 18 | 5000 | |
| MakeStyles | mount | 1105 | 1135 | 50000 | |
| Persona | mount | 1993 | 1997 | 5000 | |
| SpinButton | mount | 1544 | 1566 | 5000 |
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 3a9044346aced02d96e8cde65b46e88e8d9d32ec (build) |
|
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. Latest deployment of this branch, based on commit ef642a9:
|
🕵 fluentuiv9 No visual regressions between this PR and main |
247a5d2 to
9cce48e
Compare
9cce48e to
3a998b0
Compare
382b813 to
e1aca8c
Compare
|
Note: it's a breaking change 🚨 The hook is not re-exported from
The whole thing behind autocontrolled pattern is hard to understand for people who are not familiar with it. The separation in current implementation was intentional:
While it's nice to have less concepts, IMO current change does not make that difference more obvious to components' authors. |
I see your point and I kind of agree, although I like the simplification I can see where this might become inconvenient for some people. I'll update the PR to return |
9d8cd43 to
126881b
Compare
This hook has been annotated with @internal since the first release, we should not remove it but, but IMO breaking is fine. We have been as explicit as it gets with this one
actually yeah thinking about it some more, it could be done |
packages/react-components/react-accordion/src/components/Accordion/useAccordion.ts
Outdated
Show resolved
Hide resolved
126881b to
d185ce6
Compare
f5619c6 to
83af1b5
Compare
5cd12d0 to
11eb9ba
Compare
packages/react-components/react-utilities/src/hooks/useControllableState.test.ts
Outdated
Show resolved
Hide resolved
11eb9ba to
c822351
Compare
c822351 to
3022be8
Compare
packages/react-components/react-utilities/src/hooks/useControllableState.ts
Show resolved
Hide resolved
b79e82f to
8b0e7e3
Compare
…lableState.ts Co-authored-by: Oleksandr Fediashov <[email protected]>
8b0e7e3 to
ef642a9
Compare
* feat/drawer-header: feat: Update existing toasts (microsoft#27827) bugfix: fix horizontal overflow on tree (microsoft#27825) feat: Allow toast options to be configured from the toaster (microsoft#27820) feat: creates TreeItemAside component (microsoft#27701) fix: generate API fix: use composition to build DrawerHeaderTitle Virtualizer: Dynamic scroll view and optimizations (microsoft#27298) bugfix(react-dialog): change DialogTitle default action icon size (microsoft#27815) feat: Implement Toast pause (microsoft#27811) fix: ToolbarToggleButton should not follow Toolbar size (microsoft#27797) feat: defers useControllableState state to initializer method (microsoft#27717) feat: Implement toast dismiss (microsoft#27810)
|
🎉 Handy links: |

New Behavior
useControllableStatehook to the init method provided byuseStatehook