-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add new hooks used in migrating Fabric components to functional components #12629
Conversation
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 7fc234896718e61af6113ddab56f3d6d7ee20154 (build) |
Perf AnalysisNo significant results to display. All results
Perf Analysis (Fluent)Perf comparison
Perf tests with no regressions
|
Not sure why the Screener baseline is missing an image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks great, just the one question about useControllableState
Ping. @dzearing, is this ok to merge? |
Co-Authored-By: Elizabeth Craig <[email protected]>
Co-Authored-By: Elizabeth Craig <[email protected]>
Co-Authored-By: Elizabeth Craig <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor feedback, if the value doesn't change, don't call onChange.
Per our Teams discussion, preventing the call to |
🎉 Handy links: |
…nents (microsoft#12629) * Add new hooks used in migrating Fabric components to functional components * Change files * Cherry pick revision from MLoughry:functional/checkbox * Fix lint error * Address comments from dzearing * Fix launch.json for debugging tests * Use common onChange call signature * Fix useControllableValue types in case with no onChange handler * Export ChangeCallback type * Persist the controlled vs uncontrolled state * Update packages/react-hooks/src/useMergedRefs.ts Co-Authored-By: Elizabeth Craig <[email protected]> * Update README * Allow for undefined events in the onChange callback * Fix error in isControlled value * Delete test for deprecated behavior * Update packages/react-hooks/README.md Co-Authored-By: Elizabeth Craig <[email protected]> * Update packages/react-hooks/README.md Co-Authored-By: Elizabeth Craig <[email protected]> Co-authored-by: Elizabeth Craig <[email protected]>
Pull request checklist
$ yarn change
Description of changes
The hook changes/additions are plucked from my branches migrating a couple components to functional components (https://github.com/MLoughry/office-ui-fabric-react/tree/functional/fabric, https://github.com/MLoughry/office-ui-fabric-react/tree/functional/checkbox). While those changes may have to wait for a new major version, these changes are non-breaking and will allow me to use these hooks across further migrations while we figure out how/when to merge the migrations.
Focus areas to test
(optional)
Microsoft Reviewers: Open in CodeFlow