Closed marklanham closed 1 year ago
UPDATE: Managed to fix this by adding the following code to my component Jest test:
jest.mock('react-navigation-shared-element', () => ({
createSharedElementStackNavigator: jest.fn(),
SharedElement: ({ children }: SharedElementProps) => <>{children}</>,
}));
I’ve been trying to mock my React Native component using Jest, but each time I try to run the test I get the following error in Terminal, and it points at the SharedElement component:
Check the render method of 'MyComponent'
I added this to my
jest.setup.js
file:I’m using the following config:
Any ideas what the issue is or do you have any pointers/examples on mocking the SharedElement component?