> {
type: string
@@ -21,11 +141,12 @@ interface HostConfig {
suspenseInstance: NilNode
hydratableInstance: never
publicInstance: null
- hostContext: null
- updatePayload: {}
+ formInstance: never
+ hostContext: {}
childSet: never
timeoutHandle: number
noTimeout: -1
+ TransitionStatus: null
}
// react-reconciler exposes some sensitive props. We don't want them exposed in public instances
@@ -40,7 +161,11 @@ function getInstanceProps(props: Reconciler.Fiber['pendingProps']): HostConfig['
return instanceProps
}
-const reconciler = Reconciler<
+const NO_CONTEXT: HostConfig['hostContext'] = {}
+
+let currentUpdatePriority: number = NoEventPriority
+
+const reconciler = /* @__PURE__ */ createReconciler<
HostConfig['type'],
HostConfig['props'],
HostConfig['container'],
@@ -48,18 +173,19 @@ const reconciler = Reconciler<
HostConfig['textInstance'],
HostConfig['suspenseInstance'],
HostConfig['hydratableInstance'],
+ HostConfig['formInstance'],
HostConfig['publicInstance'],
HostConfig['hostContext'],
- HostConfig['updatePayload'],
HostConfig['childSet'],
HostConfig['timeoutHandle'],
- HostConfig['noTimeout']
+ HostConfig['noTimeout'],
+ HostConfig['TransitionStatus']
>({
isPrimaryRenderer: false,
+ warnsIfNotActing: false,
supportsMutation: true,
supportsPersistence: false,
supportsHydration: false,
- now: Date.now,
scheduleTimeout: setTimeout,
cancelTimeout: clearTimeout,
noTimeout: -1,
@@ -76,42 +202,88 @@ const reconciler = Reconciler<
removeChild: (parent, child) => parent.children.splice(parent.children.indexOf(child), 1),
removeChildFromContainer: (container) => (container.head = null),
getPublicInstance: () => null,
- getRootHostContext: () => null,
- getChildHostContext: () => null,
+ getRootHostContext: () => NO_CONTEXT,
+ getChildHostContext: () => NO_CONTEXT,
shouldSetTextContent: () => false,
finalizeInitialChildren: () => false,
- prepareUpdate: () => ({}),
- commitUpdate: (instance, _, __, ___, props) => (instance.props = getInstanceProps(props)),
+ commitUpdate: (instance, _type, _prevProps, nextProps) => (instance.props = getInstanceProps(nextProps)),
commitTextUpdate: (instance, _, value) => (instance.props.value = value),
prepareForCommit: () => null,
resetAfterCommit() {},
preparePortalMount() {},
clearContainer: (container) => (container.head = null),
- // @ts-ignore
- getCurrentEventPriority: () => DefaultEventPriority,
- beforeActiveInstanceBlur: () => {},
- afterActiveInstanceBlur: () => {},
- detachDeletedInstance: () => {},
-})
+ getInstanceFromNode: () => null,
+ beforeActiveInstanceBlur() {},
+ afterActiveInstanceBlur() {},
+ detachDeletedInstance() {},
+ prepareScopeUpdate() {},
+ getInstanceFromScope: () => null,
+ shouldAttemptEagerTransition: () => false,
+ trackSchedulerEvent: () => {},
+ resolveEventType: () => null,
+ resolveEventTimeStamp: () => -1.1,
+ requestPostPaintCallback() {},
+ maySuspendCommit: () => false,
+ preloadInstance: () => true, // true indicates already loaded
+ startSuspendingCommit() {},
+ suspendInstance() {},
+ waitForCommitToBeReady: () => null,
+ NotPendingTransition: null,
+ HostTransitionContext: /* @__PURE__ */ React.createContext