dillon1000/react

Commit

Fix problems with empty component ID registration

Fixes #2493, also closes #2353 as it incorporates a variant of that fix.

- Instead of having getEmptyComponent return `<noscript />` directly, wrap it in a class that we can easily identify later as being an empty component
- Cache the empty component element instead of recreating one each time
- Avoid touching the nullComponentIdsRegistry dictionary at all when not dealing with empty components
- Move empty-component tests to a separate file

Test Plan: jest
Browse files
Changed paths5 files
First-parent comparison
M src/core/ReactCompositeComponent.js ModifiedM src/core/ReactEmptyComponent.js ModifiedM src/core/__tests__/ReactCompositeComponent-test.js ModifiedA src/core/__tests__/ReactEmptyComponent-test.js AddedM src/test/reactComponentExpect.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…