Skip to content

Commit

Permalink
Remove comment syntax from ReactNativeTypes (#31457)
Browse files Browse the repository at this point in the history
# Summary

I'm working to get the main `react-native` package parsable by modern
Flow tooling (both `flow-bundler`, `flow-api-translator`).

This diff trivially removes some redundant Flow comment syntax in
`ReactNativeTypes.js`, which fixes parsing under these newer tools.

## How did you test this change?

Files were pasted into `react-native-github` under fbsource, where Flow
validates ✅.
  • Loading branch information
huntie authored Dec 11, 2024
1 parent 79ddf5b commit 92b62f5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/react-native-renderer/src/ReactNativeTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ declare const ensureNativeMethodsAreSynced: NativeMethods;
(ensureNativeMethodsAreSynced: INativeMethods);

export type HostInstance = NativeMethods;
/*::
export type HostComponent<Config: {...}> = component(ref: React$RefSetter<HostInstance>, ...Config);
*/
export type HostComponent<Config: {...}> = component(
ref: React$RefSetter<HostInstance>,
...Config
);

type InspectorDataProps = $ReadOnly<{
[propName: string]: string,
Expand Down Expand Up @@ -205,9 +206,7 @@ export type ReactNativeType = {
componentOrHandle: ?(ElementRef<TElementType> | number),
): ?number,
isChildPublicInstance(
// eslint-disable-next-line no-undef
parent: PublicInstance | HostComponent<empty>,
// eslint-disable-next-line no-undef
child: PublicInstance | HostComponent<empty>,
): boolean,
dispatchCommand(
Expand Down

0 comments on commit 92b62f5

Please sign in to comment.