Skip to content

Commit

Permalink
fix(reconciler): use empty host context
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett committed Apr 22, 2024
1 parent b28b1aa commit 4559147
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/fiber/src/core/reconciler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ interface HostConfig {
suspenseInstance: Instance
hydratableInstance: never
publicInstance: Instance['object']
hostContext: never
hostContext: {}
updatePayload: null | [true] | [false, Instance['props']]
childSet: never
timeoutHandle: number | undefined
Expand Down Expand Up @@ -315,6 +315,8 @@ function switchInstance(
const handleTextInstance = () =>
console.warn('R3F: Text is not allowed in JSX! This could be stray whitespace or characters.')

const NO_CONTEXT: HostConfig['hostContext'] = {}

let currentUpdatePriority: number = NoEventPriority

export const reconciler = Reconciler<
Expand Down Expand Up @@ -360,8 +362,8 @@ export const reconciler = Reconciler<

insertBefore(scene, child, beforeChild)
},
getRootHostContext: () => null,
getChildHostContext: (parentHostContext) => parentHostContext,
getRootHostContext: () => NO_CONTEXT,
getChildHostContext: () => NO_CONTEXT,
prepareUpdate(instance, _type, oldProps, newProps) {
// Reconstruct primitives if object prop changes
if (instance.type === 'primitive' && oldProps.object !== newProps.object) return [true]
Expand Down

0 comments on commit 4559147

Please sign in to comment.