11import type { ReactElement } from "react" ;
2- import type { Fiber , ReactContext , ReactProviderType } from "react-reconciler" ;
2+ import type { Fiber } from "react-reconciler" ;
33import ReactReconciler from "react-reconciler" ;
44import { DefaultEventPriority , NoEventPriority } from "react-reconciler/constants" ;
55
66import { Tag } from "./constants" ;
7- import { REACT_CONTEXT_TYPE } from "./constants" ;
87import { formatComponentList } from "./utils" ;
98
109export type Type = string ;
@@ -44,13 +43,11 @@ export type TextInstance = {
4443
4544export type SuspenseInstance = object ;
4645export type HydratableInstance = object ;
47- export type FormInstance = object ;
4846export type PublicInstance = object | TextInstance ;
4947export type UpdatePayload = unknown ;
5048export type ChildSet = unknown ;
5149export type TimeoutHandle = unknown ;
5250export type NoTimeout = unknown ;
53- export type TransitionStatus = unknown ;
5451
5552type HostContext = {
5653 type : string ;
@@ -70,13 +67,12 @@ const hostConfig: ReactReconciler.HostConfig<
7067 TextInstance ,
7168 SuspenseInstance ,
7269 HydratableInstance ,
73- FormInstance ,
7470 PublicInstance ,
7571 HostContext ,
72+ UpdatePayload ,
7673 ChildSet ,
7774 TimeoutHandle ,
78- NoTimeout ,
79- TransitionStatus
75+ NoTimeout
8076> = {
8177 /**
8278 * The reconciler has two modes: mutation mode and persistent mode. You must specify one of them.
@@ -564,6 +560,8 @@ const hostConfig: ReactReconciler.HostConfig<
564560 * be aware that it may change significantly between versions. You're taking on additional maintenance risk by
565561 * reading from it, and giving up all guarantees if you write something to it.
566562 */
563+ // @ts -expect-error @types/react-reconciler types don't fully match react-reconciler's actual Flow types.
564+ // Correctness is verified through tests.
567565 commitUpdate (
568566 instance : Instance ,
569567 type : Type ,
@@ -688,33 +686,11 @@ const hostConfig: ReactReconciler.HostConfig<
688686 // -------------------
689687 supportsHydration : false ,
690688
691- requestPostPaintCallback ( _callback : ( endTime : number ) => void ) { } ,
692-
693689 NotPendingTransition : null ,
694690
695- // Based on: https://github.com/facebook/react/blob/main/packages/react-test-renderer/src/ReactFiberConfigTestHost.js#L606
696- HostTransitionContext : {
697- $$typeof : REACT_CONTEXT_TYPE ,
698- Consumer : null as unknown as ReactContext < TransitionStatus > ,
699- Provider : null as unknown as ReactProviderType < TransitionStatus > ,
700- _currentValue : null ,
701- _currentValue2 : null ,
702- _threadCount : 0 ,
703- } ,
704-
705691 resetFormInstance ( _form : Instance ) { } ,
706692
707- trackSchedulerEvent : function ( ) : void { } ,
708-
709- // Based on: https://github.com/facebook/react/blob/main/packages/react-test-renderer/src/ReactFiberConfigTestHost.js#L256
710- resolveEventType : function ( ) : null | string {
711- return null ;
712- } ,
713-
714- // Based on: https://github.com/facebook/react/blob/main/packages/react-test-renderer/src/ReactFiberConfigTestHost.js#L259
715- resolveEventTimeStamp : function ( ) : number {
716- return - 1.1 ;
717- } ,
693+ requestPostPaintCallback ( _callback : ( endTime : number ) => void ) { } ,
718694} ;
719695
720696export const TestReconciler = ReactReconciler ( hostConfig ) ;
0 commit comments