Skip to content

Conversation

@manzt
Copy link
Contributor

@manzt manzt commented Jan 7, 2026

The file explorer uses react-arborist which internally uses react-dnd. When multiple Tree components mount or when other react-dnd contexts exist, this causes the "Cannot have two HTML5 backends at the same time" error since react-dnd only allows a single HTML5Backend instance.

These changes add a shared DnD provider wrapper that creates a single DragDropManager instance scoped to the file explorer panel. The Tree component receives this manager via the dndManager prop, preventing it from creating its own conflicting backend. The wrapper also scopes the backend to a specific root element to avoid conflicts with any other drag-and-drop functionality elsewhere in the app.

@vercel
Copy link

vercel bot commented Jan 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jan 7, 2026 7:42pm

"react-aria-components": "^1.13.0",
"react-codemirror-merge": "4.25.4",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

react-aborist was on 14. im down for 16, but does this still work? I guess if the types work

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the types seem to be fine and we dedupe in vite?

The file explorer uses `react-arborist` which internally uses
`react-dnd`. When multiple `Tree` components mount or when other
`react-dnd` contexts exist, this causes the "Cannot have two HTML5
backends at the same time" error since react-dnd only allows a single
HTML5Backend instance.

These changes add a shared DnD provider wrapper that creates a single
`DragDropManager` instance scoped to the file explorer panel. The Tree
component receives this manager via the `dndManager` prop, preventing it
from creating its own conflicting backend. The wrapper also scopes the
backend to a specific root element to avoid conflicts with any other
drag-and-drop functionality elsewhere in the app.
@manzt manzt merged commit c435814 into main Jan 7, 2026
29 checks passed
@manzt manzt deleted the push-oylwqkwvtqwp branch January 7, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants