Skip to content

Commit

Permalink
Remove comment syntax from ReactNativeTypes (#31457)
Browse files Browse the repository at this point in the history
Summary:
# 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 ✅.

DiffTrain build for [92b62f500c3fca44a9dc9ead936ef3bf19481f02](facebook/react@92b62f5)

Reviewed By: huntie

Differential Revision: D67100354

Pulled By: hoxyq

fbshipit-source-id: 575e4bd8ceefad15576273920a263ae89d027cad
  • Loading branch information
hoxyq authored and facebook-github-bot committed Dec 12, 2024
1 parent 7000b9b commit a80baac
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noformat
* @nolint
* @flow strict
* @generated SignedSource<<9cf3e28d6ca0299bc0bb5caa75b19556>>
* @generated SignedSource<<c6ea057ee85cbc116a083e3a306b2b88>>
*/

import type {ElementRef, ElementType, MixedElement} from 'react';
Expand Down Expand Up @@ -133,9 +133,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 @@ -206,9 +207,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 a80baac

Please sign in to comment.