dillon1000/react

Commit

Add React.PureComponent (#7195)

This provides an easy way to indicate that components should only rerender when given new props, like PureRenderMixin. If you rely on mutation in your React components, you can continue to use `React.Component`.

Inheriting from `React.PureComponent` indicates to React that your component doesn't need to rerender when the props are unchanged. We'll compare the old and new props before each render and short-circuit if they're unchanged. It's like an automatic shouldComponentUpdate.
Browse files
Changed paths4 files
First-parent comparison
M src/isomorphic/React.js ModifiedA src/isomorphic/modern/class/ReactPureComponent.js AddedA src/isomorphic/modern/class/__tests__/ReactPureComponent-test.js AddedM src/renderers/shared/stack/reconciler/ReactCompositeComponent.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…