Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noformat
* @nolint
* @flow strict
* @generated SignedSource<<c0e57723772ea5f1aa8c3c897ac3c216>>
* @generated SignedSource<<92e58516ae5a36a4946f0aecaf1010fa>>
*/

import type {
Expand Down Expand Up @@ -84,7 +84,7 @@ type InspectorDataProps = $ReadOnly<{
}>;

type InspectorDataGetter = (
<TElementType: React.ElementType>(
<TElementType extends React.ElementType>(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid generic bound syntax for a @flow strict file

This file is annotated @flow strict (line 9) and uses Flow-specific constructs throughout ($ReadOnly, $FlowFixMe, opaque type, mixed, ? nullable types). Flow uses the : colon syntax for bounded generics — extends is TypeScript syntax. The codemod changed all five occurrences of <TElementType: React.ElementType> to <TElementType extends React.ElementType>, which is not valid Flow and will cause flow check to fail under strict mode.

The same pattern applies at lines 146, 149, 175, and 178. For example:

Suggested change
<TElementType extends React.ElementType>(
<TElementType: React.ElementType>(

All five occurrences would need to be reverted to : unless the file's @flow strict annotation is simultaneously removed and the remaining Flow-specific syntax ($ReadOnly, opaque type, etc.) is also migrated to TypeScript.

componentOrHandle: React.ElementRef<TElementType> | number,
) => ?number,
) => $ReadOnly<{
Expand Down Expand Up @@ -143,10 +143,10 @@ export type RenderRootOptions = {
* Provide minimal Flow typing for the high-level RN API and call it a day.
*/
export type ReactNativeType = {
findHostInstance_DEPRECATED<TElementType: React.ElementType>(
findHostInstance_DEPRECATED<TElementType extends React.ElementType>(
componentOrHandle: ?(React.ElementRef<TElementType> | number),
): ?PublicInstance,
findNodeHandle<TElementType: React.ElementType>(
findNodeHandle<TElementType extends React.ElementType>(
componentOrHandle: ?(React.ElementRef<TElementType> | number),
): ?number,
isChildPublicInstance(parent: PublicInstance, child: PublicInstance): boolean,
Expand All @@ -172,10 +172,10 @@ export opaque type Node = mixed;
export opaque type InternalInstanceHandle = mixed;

export type ReactFabricType = {
findHostInstance_DEPRECATED<TElementType: React.ElementType>(
findHostInstance_DEPRECATED<TElementType extends React.ElementType>(
componentOrHandle: ?(React.ElementRef<TElementType> | number),
): ?PublicInstance,
findNodeHandle<TElementType: React.ElementType>(
findNodeHandle<TElementType extends React.ElementType>(
componentOrHandle: ?(React.ElementRef<TElementType> | number),
): ?number,
dispatchCommand(
Expand Down
Loading