dillon1000/react

Commit

Make ReactTextComponent properly injectable

ReactTextComponent's implementation is DOM-specific; instead of flattenChildren creating the ReactTextComponent instances, ReactNativeComponent now takes care of having ReactTextComponent injected and creating the component instance. I also renamed ReactTextComponent to ReactDOMTextComponent and moved it to browser/ui/ where it belongs. ReactDOMTextComponent no longer inherits directly from ReactComponent and instead implements construct and {mount,receive,unmount}Component directly.

This diff removes `ReactTestUtils.isTextComponent` which should have previously never returned true when using public APIs.

Test Plan: jest, use ballmer-peak example.
Browse files
Changed paths14 files
First-parent comparison
M docs/docs/10.4-test-utils.md ModifiedM src/browser/ui/React.js ModifiedR src/browser/ReactTextComponent.js →src/browser/ui/ReactDOMTextComponent.js RenamedM src/browser/ui/ReactDefaultInjection.js ModifiedR src/core/__tests__/ReactTextComponent-test.js →src/browser/ui/__tests__/ReactDOMTextComponent-test.js RenamedM src/core/ReactMultiChild.js ModifiedM src/core/ReactNativeComponent.js ModifiedM src/core/__tests__/ReactMultiChildText-test.js ModifiedM src/core/instantiateReactComponent.js ModifiedM src/core/shouldUpdateReactComponent.js ModifiedM src/test/ReactTestUtils.js ModifiedM src/test/reactComponentExpect.js ModifiedM src/utils/flattenChildren.js ModifiedM src/utils/traverseAllChildren.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…