dillon1000/react

Commit

[Fiber] Fix tests for Fiber in ReactElement-test (#8150)

* Test Fiber internals differently in ReactElement

Instead of being able to access the owner's instance via getPublicInstance(), we use the Fiber's stateNode. (Fiber does not have methods, it's just a structure!)

* Fix isCompositeComponentWithType for fiber

In ReactTestUtils.isCompositeComponentWithType, we provide a way to walk through Fiber's internals in place of using _currentElement.type. We keep support for non-fiber though.

* Test fiber reconciler consistently

Use typeof instance.tag to test if we're using the fiber reconciler

* Remove unnecessary comment
Browse files
Changed paths2 files
First-parent comparison
M src/isomorphic/classic/element/__tests__/ReactElement-test.js ModifiedM src/test/ReactTestUtils.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…