Skip to content

Commit

Permalink
[flow][libdef] Remove React$FragmentType
Browse files Browse the repository at this point in the history
Summary: Changelog: [lib] The internal type `React$FragmentType` is removed from Flow's builtin global type definitions.

Reviewed By: alexmckenley

Differential Revision: D67990844

fbshipit-source-id: f7ba1d6cdbd593b130c37ae0821c396fb334131e
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Jan 16, 2025
1 parent 7804f88 commit 28f5d98
Show file tree
Hide file tree
Showing 16 changed files with 309 additions and 311 deletions.
2 changes: 0 additions & 2 deletions lib/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,6 @@ declare opaque type React$Context<T>: React$ComponentType<{
*/
declare opaque type React$Portal;

declare type React$FragmentType = $Exports<'react'>['Fragment'];

declare namespace React {
type ComponentType<-P> = React$ComponentType<P>;
type PropsOf<E: string | React$MixedElement | React$RendersExactly<React$ElementType>> = E extends React$Element<infer C> ? React$ElementConfig<C> : E extends React$RendersExactly<infer C> ? React$ElementConfig<C> : (E extends string ? $JSXIntrinsics[E]['props'] : empty);
Expand Down
4 changes: 2 additions & 2 deletions tests/badly_positioned_react/badly_positioned_react.exp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ References:
test.js:21:29
21| const Foo1 = create(create1<{||}>(Foo));
^^^^ [2]
<BUILTINS>/react.js:353:38
353| declare export type ComponentType<-P> = React$ComponentType<P>;
<BUILTINS>/react.js:351:38
351| declare export type ComponentType<-P> = React$ComponentType<P>;
^ [3]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Cannot cast `3` to indexed access because number [1] is incompatible with compon
^ [1]

References:
<BUILTINS>/react.js:752:5
<BUILTINS>/react.js:750:5
v------------------------------------------------------
752| declare component Fragment<Renders: React$Node = void>(
753| children?: Renders,
754| ) renders Renders;
750| declare component Fragment<Renders: React$Node = void>(
751| children?: Renders,
752| ) renders Renders;
-----------------^ [2]


Expand Down
16 changes: 8 additions & 8 deletions tests/component_type/component_type.exp
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ References:
component_to_component.js:26:37
26| x: component(ref: React.RefSetter<Component>, ...{...}),
^^^^^^^^^ [2]
<BUILTINS>/react.js:369:34
369| declare export type RefSetter<-T> = React$RefSetter<T>;
<BUILTINS>/react.js:367:34
367| declare export type RefSetter<-T> = React$RefSetter<T>;
^ [3]


Expand Down Expand Up @@ -426,8 +426,8 @@ Cannot create `C` element because in property `ref`: [incompatible-type]
^^^^^^

References:
<BUILTINS>/react.js:702:8
702| ): React$RefObject<T | null>;
<BUILTINS>/react.js:700:8
700| ): React$RefObject<T | null>;
^^^^^^^^^^^^^^^^^^^^^^^^^ [1]
<BUILTINS>/react.js:197:6
197| | ((T | null) => mixed)
Expand Down Expand Up @@ -575,8 +575,8 @@ References:
<BUILTINS>/core.js:2060:19
2060| declare class Set<T> extends $ReadOnlySet<T> {
^ [3]
<BUILTINS>/react.js:239:19
239| type RefSetter<-T> = React$RefSetter<T>;
<BUILTINS>/react.js:237:19
237| type RefSetter<-T> = React$RefSetter<T>;
^ [4]


Expand Down Expand Up @@ -991,8 +991,8 @@ References:
<BUILTINS>/core.js:2060:19
2060| declare class Set<T> extends $ReadOnlySet<T> {
^ [3]
<BUILTINS>/react.js:239:19
239| type RefSetter<-T> = React$RefSetter<T>;
<BUILTINS>/react.js:237:19
237| type RefSetter<-T> = React$RefSetter<T>;
^ [4]


Expand Down
4 changes: 2 additions & 2 deletions tests/new_generics/new_generics.exp
Original file line number Diff line number Diff line change
Expand Up @@ -1031,8 +1031,8 @@ References:
react.js:13:28
13| a as React.ComponentType<{a: number}>; // nope, contravariance
^^^^^^^^^^^ [2]
<BUILTINS>/react.js:353:38
353| declare export type ComponentType<-P> = React$ComponentType<P>;
<BUILTINS>/react.js:351:38
351| declare export type ComponentType<-P> = React$ComponentType<P>;
^ [3]


Expand Down
Loading

0 comments on commit 28f5d98

Please sign in to comment.