dillon1000/react
Commit
Browse files Support configurable labels for custom hooks (#14559)
* react-debug-tools accepts currentDispatcher ref as param * ReactDebugHooks injected dispatcher ref is optional * Support custom values for custom hooks * PR feedback: 1. Renamed useDebugValueLabel hook to useDebugValue 2. Wrapped useDebugValue internals in if-DEV so that it could be removed from production builds. * PR feedback: 1. Fixed some minor typos 2. Added inline comment explaining the purpose of rollupDebugValues() 3. Refactored rollupDebugValues() to use a for loop rather than filter() 4. Improve check for useDebugValue hook to lessen the chance of a false positive 5. Added optional formatter function param to useDebugValue * Nitpick renamed a method
Changed paths7 files
First-parent comparisonpackages/react-debug-tools/src/ReactDebugHooks.js ModifiedM packages/react-debug-tools/src/__tests__/ReactHooksInspection-test.internal.js ModifiedM packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.internal.js ModifiedM packages/react-reconciler/src/ReactFiberDispatcher.js ModifiedM packages/react-reconciler/src/ReactFiberHooks.js ModifiedM packages/react/src/React.js ModifiedM packages/react/src/ReactHooks.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…