- Issue created by @lauriii
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
I have no idea how to reproduce this, but I do see this is a dependency. Hopefully @balintbrews can tie the code to the exception and determine steps to reproduce?
- 🇳🇱Netherlands balintbrews Amsterdam, NL
This is the one error that's been hunting me, because I don't know what causes it and how to reproduce. I've seen it occasionally, but I never had time to dig into it. All I know is that it comes from
react-mosaic
. Any ideas, @hooroomoo? - 🇫🇮Finland lauriii Finland
I do not have steps to reproduce for this but this is something I've been running into quite frequently today. It might warrant some investigation.
- 🇳🇱Netherlands balintbrews Amsterdam, NL
I don't have the exact steps to reproduce, but I may have an understanding of why this error occurs.
react-mosaic
usesreact-dnd
for its drag & drop functionality. TheMosaic
component wraps its logic in theDndProvider
fromreact-dnd
. I believe the problem we're seeing is that when we switch between routes, that context provider sometimes can't fully unmount itself before the new provider starts mounting itself on the new route. The solution is to decoupleDndProvider
from where we use theMosaic
component. Luckily,react-mosaic
exportsMosaicWithoutDragDropContext
for us to do that.So I'm adding
react-dnd
,rdndmb-html5-to-touch
, andreact-dnd-multi-backend
as explicit dependencies — they were already indirectly added byreact-mosaic
— and wrapping everything in the context provider inApp.tsx
, so we can replace our use of theMosaic
component withMosaicWithoutDragDropContext
. The provider then remains stable while switching between routes.This is all just theory, as I don't have a way to reproduce the error. Let's thoroughly test that he new context provider doesn't cause issues with our other drag & drop library, dnd kit. Yes, ideally we would only use one, but this was so far an implementation detail of
react-mosaic
, and we already heavily based our content preview canvas interactions heavily on dnd kit.For future consideration, I opened ✨ Move away from react-mosaic for the code editor UI Postponed .
- 🇺🇸United States hooroomoo
I pulled this down and tried to reproduce the error by switching the routes consecutively but couldn't.
@balintbrews theory is very solid and the code is well commented so I think it makes sense to get this in and see if it solves the issue on 0.x since there are no exact steps to reproduce it.
-
balintbrews →
committed 82bcb957 on 0.x
Issue #3510436 by balintbrews, lauriii, hooroomoo: Code editor crashes...
-
balintbrews →
committed 82bcb957 on 0.x