dillon1000/react
Commit
Browse files Allow arbitrary types to be wrapped in pure (#13903)
* Allow arbitrary types to be wrapped in pure This creates an outer fiber that container the pure check and an inner fiber that represents which ever type of component. * Add optimized fast path for simple pure function components Special cased when there are no defaultProps and it's a simple function component instead of class. This doesn't require an extra fiber. We could make it so that this also works with custom comparer but that means we have to go through one extra indirection to get to it. Maybe it's worth it, donno.
Changed paths10 files
First-parent comparisonpackages/react-reconciler/src/ReactFiber.js ModifiedM packages/react-reconciler/src/ReactFiberBeginWork.js ModifiedM packages/react-reconciler/src/ReactFiberCompleteWork.js ModifiedM packages/react-reconciler/src/__tests__/ReactPure-test.internal.js ModifiedM packages/react-reconciler/src/__tests__/__snapshots__/ReactIncrementalPerf-test.internal.js.snap ModifiedM packages/react-test-renderer/src/ReactTestRenderer.js ModifiedM packages/react/src/__tests__/forwardRef-test.js ModifiedM packages/react/src/pure.js ModifiedM packages/shared/ReactWorkTags.js ModifiedM packages/shared/getComponentName.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…