dillon1000/react

Commit

Don't mutate passed-in props

Depends on #575; fixes #570.  Now we'll be in trouble if someone tries to share objects between calls to getDefaultProps but that was already true of getInitialState and I haven't heard any complaints there.

This is the same number of allocations as before; we're just copying props in the other direction. (In any case, the copy happens only on mount and there are a couple dozen costlier things we're doing already at that time.)
Browse files
Changed paths2 files
First-parent comparison
M src/core/ReactCompositeComponent.js ModifiedM src/core/__tests__/ReactCompositeComponent-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…