dillon1000/react

Commit

Make class prop resolution faster (#28766)

`delete` causes an object (in V8, and maybe other engines) to deopt to a
dictionary instead of a class. Instead of `assign` + `delete`, manually
iterate over all the properties, like the JSX runtime does.

To avoid copying the object twice I moved the `ref` prop removal to come
before handling default props. If we already cloned the props to remove
`ref`, then we can skip cloning again to handle default props.
Browse files
Changed paths2 files
First-parent comparison
M packages/react-reconciler/src/ReactFiberClassComponent.js ModifiedM packages/react-server/src/ReactFizzServer.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…