mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
205cc9bc3b
Summary: In `buildEventSchema` and `buildPropSchema`, they check into property types to see if the given property could be converted into an event schema or a property schema. The original implementation only handles limited cases, I refactor them and make them easier to maintain. In `getPropertyType` in `events.js`, it handles `(T)` at a wrong place, fixed. In `getPropertyType` in `props.js`, it doesn't handle `(T)`, fixed. And I also fixed some other issues to make the codegen reports error better. There are many duplicated test cases that cover every piece of the code, I changed some of them so that it tests both original cases and new cases. ## Changelog [General] [Changed] - Handle (T) and undefined properly in turbo module component codegen Pull Request resolved: https://github.com/facebook/react-native/pull/34693 Test Plan: `yarn jest` passed in `packages/react-native-codegen` Reviewed By: NickGerleman Differential Revision: D39647075 Pulled By: cipolleschi fbshipit-source-id: 8e1df2b54aab37b7151d0bf74260e2eba0602777