dillon1000/react

Commit

Cache Default Props

The `getDefaultProps` return value should not be dependent on any external data (including `this.props` and `this.state`), so the return value should be consistent everytime we call it.

This caches the return value so we do not do work and allocate memory unnecessarily.
Browse files
Changed paths1 file
First-parent comparison
M src/core/ReactCompositeComponent.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…