react-sortable-tree icon indicating copy to clipboard operation
react-sortable-tree copied to clipboard

Cannot read property 'getMonitor' of undefined

Open slemvs opened this issue 8 years ago • 9 comments

Hi, Could you help me with this problem, please? I try to use SortableTree with touch support. I copied code sample (touch-support) from storybook app and when i try to use this:

import { SortableTreeWithoutDndContext as SortableTree } from "react-sortable-tree";

instead of this

import SortableTree from "react-sortable-tree";

I got error: image

I have prepared a code sample to reproduce the error https://codesandbox.io/s/ov1n19x0r5

slemvs avatar Jun 28 '18 07:06 slemvs

I tried sample from your sandbox https://codesandbox.io/s/1r3vz5mmyj from this page and is not working too. Error the same.

slemvs avatar Jun 28 '18 08:06 slemvs

It seems that the problem is related to the version of react-dnd library. If you use the version 3.0.2 it works! But if you switch to the latest 5.0.1 version you receive an error as above.

slemvs avatar Jun 28 '18 08:06 slemvs

so many react dnd bugs #336 .... :(

wuweiweiwu avatar Jun 28 '18 09:06 wuweiweiwu

@slemvs , @wuweiweiwu I attempted an upgrade but the react-dnd is now using the latest this.context which breaks many parts in the code... will try again when I have a solid block of time to resolve this or @wuweiweiwu, I saw your comments that you will take a look?

lifejuggler avatar Jul 01 '18 21:07 lifejuggler

@lifejuggler Thanks for taking a look! I was planning on it. But havent had time recently.

wuweiweiwu avatar Jul 02 '18 07:07 wuweiweiwu

Hi! Is there a workaround to this problem until it get's solved?

votiv avatar Jul 05 '18 12:07 votiv

@votiv Yes, just switch the version of react-dnd from latest to 3.0.2. In my case it helped. https://codesandbox.io/s/98kj095wwy

slemvs avatar Jul 05 '18 16:07 slemvs

@slemvs Unfortunately downgrading react-dnd to 3.0.2 did not work... Still same error.

NouraldinS avatar Nov 01 '18 12:11 NouraldinS

@slemvs Unfortunately downgrading react-dnd to 3.0.2 did not work... Still same error.

@NoureldeanSaed There is a working example https://codesandbox.io/s/98kj095wwy. Please, check all dependencies versions in it.

slemvs avatar Nov 01 '18 15:11 slemvs