dillon1000/react

Commit

Add warnings when accessing properties/methods on unmounted components

This creates a membrane around the React component prototype. It warns if you
try to access properties on the component before it's unmounted. Before it's
mounted, it should be considered a descriptor and not an actual instance.

The workaround, for unknown types, is to access the constructor using
component.type which has static methods on it.
Browse files
Changed paths7 files
First-parent comparison
M src/browser/ReactDOM.js ModifiedM src/browser/ReactTextComponent.js ModifiedM src/core/ReactComponent.js ModifiedM src/core/ReactCompositeComponent.js ModifiedM src/core/__tests__/ReactComponent-test.js ModifiedM src/core/__tests__/ReactCompositeComponent-test.js ModifiedM src/test/ReactTestUtils.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…