Current behavior
This is with react native. When I use shallow rendering with enzyme, all components seem to be wrapped in a forwardRef. For example, if I do this in a test
const wrapper = shallow(
<TestView/>
);
console.log(wrapper.debug())
where TestView is
export const TestView: FC<PropType> = (props: PropType) => {
return (
<Text>Hello World</Text>
);
};
The resulting output is
<ForwardRef(Text)>
Hello World
</ForwardRef(Text)>
The problem with this is that you cannot do wrapper.find("Text"), and instead have to do wrapper.find('ForwardRef(Text') which is a lot less clear and seems fragile.
Expected behavior
I would expect the component to be just
<Text>
Hello World
</Text>
Your environment
React Native 0.59.5
API
Version
| library |
version |
| enzyme |
3.6.0 |
| react |
16.8.6 |
| react-dom |
16.0.6 |
| react-test-renderer |
16.8.6 |
| adapter (below) |
|
Adapter
Current behavior
This is with react native. When I use
shallowrendering with enzyme, all components seem to be wrapped in aforwardRef. For example, if I do this in a testwhere
TestViewisThe resulting output is
The problem with this is that you cannot do
wrapper.find("Text"), and instead have to dowrapper.find('ForwardRef(Text')which is a lot less clear and seems fragile.Expected behavior
I would expect the component to be just
Your environment
React Native 0.59.5
API
Version
Adapter