Files
react-native/packages/react-native/jest
Tim Yung fb58494283 RN: Fix mockComponent for Functional Components (#45196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45196

Currently, `mockComponent` makes a false assumption that if a component is a function, it extends `React.Component`.

There's a bunch of problems with this mocking setup with requiring mock components that extend `React.Component`, but this change does not attemp to solve that.

This change unblocks future refactors to make native components export functional components (that are neither class component nor `forwardRef` results).

Changelog:
[General][Changed] - Fixed native component mocking in Jest unit tests to support functional components

Reviewed By: javache

Differential Revision: D59097730

fbshipit-source-id: ca2784ac3baa9ab4ab6a503c5fd6437c60179352
2024-06-27 07:26:04 -07:00
..