dillon1000/react

Commit

Warn if getDOMNode or isMounted is accessed in render

This is an anti-pattern that can be easily avoided by putting the logic
in componentDidMount and componentDidUpdate instead.

It creates a dependency on stale data inside render without enforcing
a two-pass render.
Browse files
Changed paths6 files
First-parent comparison
M src/browser/__tests__/ReactDOM-test.js ModifiedM src/browser/findDOMNode.js ModifiedM src/classic/class/ReactClass.js ModifiedM src/core/__tests__/ReactComponent-test.js ModifiedM src/core/__tests__/ReactComponentLifeCycle-test.js ModifiedM src/core/instantiateReactComponent.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…