Files
react-native/packages/react-native-codegen
Cameron Bourke be07435e6a Allow type exports from the typed native component
Summary:
## Context
At the moment, the codegen process does not expect any types defined in a native component (*NativeComponent.js) to be exported. For example, the `NativeProps` type may be defined as:

```
// RCTSegmentedControlNativeComponent.js

type NativeProps = $ReadOnly<{|
   ...
   onChange?: ?(event: BubblingEvent<Event>) => mixed,
|}>;
```

However, it would be helpful to be able to reuse `NativeProps` in the user facing component:

```
// SegmentedControlIOS.js

type Props = $ReadOnly<{|
   ...NativeProps
  onValueChange?: ?(value: number) => mixed,
|}>;
```

## Changes
- updates the `getTypes` function to unwrap the type declaration inside exported declarations
- add test to verify that exported types are parsed as expected

Reviewed By: rickhanlonii

Differential Revision: D15851693

fbshipit-source-id: a9cd375c69cbb8fe9a38be3d2a681227444fb33d
2019-06-17 09:05:09 -07:00
..
2019-05-22 06:02:03 -07:00
2019-06-07 12:31:36 -07:00
2019-06-07 12:31:36 -07:00