dillon1000/react

Commit

Make setState in render a warning, not an invariant

We keep track of the fact that something is rendering for a bunch of
warnings. (ReactCurrentOwner.current !== null)

Once we get rid of owner for string refs, I'll convert those to something
like "isRendering" instead. The interesting part is that feature `__DEV__`
only. It is only used for warnings. Except for this case.

This means that we can get rid of the special case for the isRendering
stack on in prod.
Browse files
Changed paths2 files
First-parent comparison
M src/renderers/shared/reconciler/ReactUpdateQueue.js ModifiedM src/renderers/shared/reconciler/__tests__/ReactCompositeComponent-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…