dillon1000/react

Commit

Simplify composite lifecycle state

We now forbid calling setState or forceUpdate if any component's render function is higher in the stack, not just the component you're trying to update. (We do this already now for React.renderComponent and React.unmountComponentAtNode.)

This also has the advantage that we can now remove CompositeLifeCycle.RECEIVING_STATE, making _compositeLifeCycleState easier to reason about (not to mention that RECEIVING_STATE was a confusing name) and making it possible to remove a try/finally from the render path which might help with perf.
Browse files
Changed paths1 file
First-parent comparison
M src/core/ReactCompositeComponent.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…