You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm facing an issue where the context from DropZoneProvider is not being properly passed down to the DropZoneRender component. Despite correctly wrapping the DropZone components with DropZoneProvider, the context becomes null or undefined at certain child components (specifically within Columns and Section), while it remains intact at higher levels, such as the Root component.
Steps to Reproduce:
Wrap a DropZone inside a DropZoneProvider within the Root component.
Use DropZone inside Columns (which is a part of the rendered content) with zones like column-0, column-1, etc.
During render, the context logs correctly at the Root level but turns null or undefined inside DropZoneRender at the Columns level.
Expected Behavior:
The context from DropZoneProvider should be consistently available across all child components, especially inside DropZoneRender, without becoming null.
Actual Behavior:
The context is available at the Root component but turns null inside DropZoneRender when rendering specific columns inside Columns. The issue persists even after memoizing DropZoneProvider to reduce unnecessary re-renders.
Logs:
At the Root level, the context is logged correctly:
This issue occurs in one of my projects, but the same setup works fine in another project where DropZoneProvider passes context correctly.
I'm using React 18.3.0, and the issue persists even after updating dependencies.
Could this be related to React's context propagation or a potential conflict with useMemo/useState within DropZoneProvider? Any guidance or suggestions from the community would be greatly appreciated!
Environment:
React version: 18.3.0
Context API:React.createContext
Related Libraries:@measured/dnd, custom components (DropZone, Columns, etc.)
i use version v0.16.1 and use demo to run
Feel free to tweak the details to better match your exact scenario!
The text was updated successfully, but these errors were encountered:
I'm facing an issue where the context from
DropZoneProvider
is not being properly passed down to theDropZoneRender
component. Despite correctly wrapping theDropZone
components withDropZoneProvider
, the context becomesnull
orundefined
at certain child components (specifically withinColumns
andSection
), while it remains intact at higher levels, such as theRoot
component.Steps to Reproduce:
DropZone
inside aDropZoneProvider
within theRoot
component.DropZone
insideColumns
(which is a part of the rendered content) with zones likecolumn-0
,column-1
, etc.Root
level but turnsnull
orundefined
insideDropZoneRender
at theColumns
level.Expected Behavior:
The context from
DropZoneProvider
should be consistently available across all child components, especially insideDropZoneRender
, without becomingnull
.Actual Behavior:
The context is available at the
Root
component but turnsnull
insideDropZoneRender
when rendering specific columns insideColumns
. The issue persists even after memoizingDropZoneProvider
to reduce unnecessary re-renders.Logs:
Root
level, the context is logged correctly:DropZoneRender
, the context becomes:Things I have tried:
DropZoneProvider
usingReact.memo
to prevent unnecessary re-renders.DropZoneProvider
to check if they are being re-mounted or unmounted. (They are not.)key
of eachDropZoneProvider
is stable and unique.Code Example:
Here is a simplified version of the component structure:
Additional Info:
DropZoneProvider
passes context correctly.React 18.3.0
, and the issue persists even after updating dependencies.Could this be related to React's context propagation or a potential conflict with
useMemo
/useState
withinDropZoneProvider
? Any guidance or suggestions from the community would be greatly appreciated!Environment:
React.createContext
@measured/dnd
, custom components (DropZone
,Columns
, etc.)i use version v0.16.1 and use demo to run
Feel free to tweak the details to better match your exact scenario!
The text was updated successfully, but these errors were encountered: