dillon1000/react
Commit
Browse files 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.)
Changed paths2 files
First-parent comparisonsrc/core/ReactCompositeComponent.js ModifiedM src/core/__tests__/ReactCompositeComponent-test.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…