Skip to content

Commit

Permalink
Merge pull request #739 from contember/fix/binding-reset-tree-id
Browse files Browse the repository at this point in the history
reset tree root id context in DataBindingProvider
  • Loading branch information
matej21 authored Jul 2, 2024
2 parents 423e7ff + f8d9e28 commit 68a4470
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ComponentType, createElement, memo, ReactElement, ReactNode } from 'react'
import { AccessorTree, AccessorTreeState, AccessorTreeStateOptions, useDataBinding } from '../accessorTree'
import { TreeRootIdProvider } from '../accessorPropagation'

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

0 comments on commit 68a4470

Please sign in to comment.