Files
react-native/packages/react-native-codegen
shubham0142 ec66f2eeb9 Codegen 113: add isOptionalProperty in parser (#37134)
Summary:
part of codegen issue https://github.com/facebook/react-native/issues/34872
Add a function isOptionalProperty(property) in the Parser object and implement it in FlowParser and TypeScriptParser, using the implementation you can find in the [parsers/flow/components/events.js](https://github.com/facebook/react-native/blob/e133100721939108b0f28dfa9f60ac627c804018/packages/react-native-codegen/src/parsers/flow/components/events.js#L172-L173) and [parsers/typescript/components/events.js](https://github.com/facebook/react-native/blob/e133100721939108b0f28dfa9f60ac627c804018/packages/react-native-codegen/src/parsers/typescript/components/events.js#L196). Use the parsers in the buildPropertiesForEvent.

bypass-github-export-checks

## Changelog:
[Internal][Changed]: add isOptionalProperty in parser and use it in parser events.
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/37134

Test Plan: `yarn test react-native-codegen`

Reviewed By: christophpurrer

Differential Revision: D45390880

Pulled By: cipolleschi

fbshipit-source-id: bb2575b8602c6a15be0a87817ca1961ae834324e
2023-05-09 05:35:45 -07:00
..
2022-02-22 02:23:02 -08:00
2020-09-29 14:39:40 -07:00

@react-native/codegen

Version

Installation

yarn add --dev @react-native/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/react-native-codegen.