Skip to content

Commit

Permalink
fix(react-binding): reset entity key context in new databinding provider
Browse files Browse the repository at this point in the history
  • Loading branch information
matej21 committed Jul 10, 2024
1 parent c985c47 commit 6cc7fb0
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ComponentType, createElement, memo, ReactElement, ReactNode } from 'react'
import { AccessorTree, AccessorTreeState, AccessorTreeStateOptions, useDataBinding } from '../accessorTree'
import { TreeRootIdProvider } from '../accessorPropagation'
import { EntityKeyContext } from '../accessorPropagation/EntityKeyContext'

export type DataBindingProviderStateComponent<StateProps> = (
| {
Expand Down Expand Up @@ -53,9 +54,11 @@ export const DataBindingProvider = memo(function DataBindingProvider<StateProps
: props.children
return (
<TreeRootIdProvider treeRootId={undefined}>
<AccessorTree state={accessorTreeState}>
{children}
</AccessorTree>
<EntityKeyContext.Provider value={undefined}>
<AccessorTree state={accessorTreeState}>
{children}
</AccessorTree>
</EntityKeyContext.Provider>
</TreeRootIdProvider>
)
}) as <StateProps>(props: DataBindingProviderProps<StateProps>) => ReactElement

0 comments on commit 6cc7fb0

Please sign in to comment.