mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
c0a46c696b
Summary: >[Codegen 95] Extract the `defaultExports.forEach(statement =>` (Flow, TS) function in `parser-commons`, so that it accept a Parser parameter to unify the behaviors between flow and typescript. The Parser object needs to be enriched with all the methods to extract the required information from the Node, if they are not there yet. ### Changes - merged TS & Flow parsers' logic for `defaultExports.forEach(statement =>` of `/components/index.js:findComponentConfig()` into; - `findNativeComponentType` fn to `parsers-commons.js` - add `getTypeArgumentParamsFromDeclaration` & `getNativeComponentType` fn's - add **_tests_** for getTypeArgumentParamsFromDeclaration & `getNativeComponentType` fn's ## Changelog [INTERNAL] [CHANGED] - Merge `defaultExports.forEach(statement => ...` (Flow, TS) to `findNativeComponentType` fn in `parser-commons.js` Pull Request resolved: https://github.com/facebook/react-native/pull/36466 Test Plan: - `yarn lint && yarn run flow && yarn jest react-native` ⇒ � Reviewed By: rshest Differential Revision: D44088862 Pulled By: cipolleschi fbshipit-source-id: 91bf0edcd53b2e054160af34d7c128355c178b26