react-native/packages/react-native-test-library
Riccardo Cipolleschi fe1057afcd Let lib maintainer be explicit with componentProvider mapping (#47520)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47520

Right now, when a 3p library needs to register a component in the component system, we have to crawl the library to try and get the mappng, best effort.

With this approach, we are enriching the `codegenConfig` property to allow library developers to define the mapping themselves.

For example:
```json
//...
"codegenConfig": {
    //..
    "ios": {
      "componentProvider": {
        "RNTMyNativeView": "RNTMyNativeViewComponentView"
      }
    }
  },
```
means that the JS component `RNTMyNativeView` will be mapped to the `RNTMyNativeViewComponentView` class.

This also work for local apps, and it warns the users about what libraries are using the deprecated approach, so they can open an issue or a PR to those libraries.

## Changelog:
[iOS][Added] - Allow 3p developers to specify the association between components and classes in Fabric

Reviewed By: dmytrorykun

Differential Revision: D65666061

fbshipit-source-id: 692e753635873ff9260e131d2d18ed226b2378c2
2024-11-12 07:38:03 -08:00
..
android Bump Kotlin 1.9.x to 2.0.x (#46955) 2024-10-11 05:34:02 -07:00
ios Fix Cxx TurboModule methods not being cached (#46751) 2024-10-02 05:10:33 -07:00
src
babel.config.js
index.js
OSSLibraryExample.podspec
package.json Let lib maintainer be explicit with componentProvider mapping (#47520) 2024-11-12 07:38:03 -08:00
react-native.config.js
README.md

Important

This package is for testing only. It is a subject to frequent change. It does not represent the recomended structure for React native libraries. It should not be used as a referece for such purposes.

Building

yarn install
yarn build
npx react-native codegen