dillon1000/react
Commit
Browse files 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.
Changed paths6 files
First-parent comparisonsrc/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 ModifiedPatch
Files changed
Rendering syntax-highlighted changes…