Skip to content

Commit

Permalink
fix(react-binding): reset tree root id context in DataBindingProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
matej21 committed Jul 2, 2024
1 parent 423e7ff commit f8d9e28
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 f8d9e28

Please sign in to comment.