02957718d7
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/40860 This diff adds support for the `AS` expression in TS sources. The following codegen declaration should work now: ``` export default codegenNativeComponent<NativeProps>( 'MyComponentView', ) as HostComponent<NativeProps>; ``` Changelog: [General][Added] - Handle TSAsExpression when looking for the codegen declaration Reviewed By: shwanton Differential Revision: D50225241 fbshipit-source-id: 247a3d341d742b548e82318d0fa21dff9884d2bd |
||
---|---|---|
.. | ||
__test_fixtures__ | ||
__tests__ | ||
README.md | ||
index.js | ||
package.json |
README.md
@react-native/babel-plugin-codegen
Installation
yarn add --dev @babel/core @react-native/babel-plugin-codegen
Note: We're using yarn
to install deps. Feel free to change commands to use npm
3+ and npx
if you like
Testing
To run the tests in this package, run the following commands from the React Native root folder:
yarn
to install the dependencies. You just need to run this onceyarn jest packages/babel-plugin-codegen
.