react-native-macos/packages/babel-plugin-codegen
Dmitry Rykun 02957718d7 SVC Codegen: Handle TSAsExpression when looking for the codegen declaration (#40860)
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
2023-10-12 11:24:16 -07:00
..
__test_fixtures__ Revert ESM imports 2023-02-28 10:23:36 -08:00
__tests__ Revert ESM imports 2023-02-28 10:23:36 -08:00
README.md Add missing READMEs & Update package.json in all RN packages (#37090) 2023-04-28 04:26:20 -07:00
index.js SVC Codegen: Handle TSAsExpression when looking for the codegen declaration (#40860) 2023-10-12 11:24:16 -07:00
package.json Bump package versions for next major (#39764) 2023-10-11 08:36:23 -07:00

README.md

@react-native/babel-plugin-codegen

Version

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:

  1. yarn to install the dependencies. You just need to run this once
  2. yarn jest packages/babel-plugin-codegen.