React-sortable-tree: TypeError: this.clearMonitorSubscription is not a function. (In 'this.clearMonitorSubscription()', 'this.clearMonitorSubscription' is undefined)

Created on 10 Dec 2018  路  7Comments  路  Source: frontend-collective/react-sortable-tree

This issue is still biting and it has been over a year since someone posted :).

It seems the 'current' solution is really depending on react-dnd version 3.0.2.

Is there a new update for this that does not require me to move from the latest, which is like on version 7, down to version 3?

Most helpful comment

encountered again:

    "react": "^17.0.1",
    "react-dom": "^17.0.1",
    "react-scripts": "4.0.0",
    "react-sortable-tree": "^2.8.0",

See: https://github.com/frontend-collective/react-sortable-tree/issues/830

All 7 comments

I created the most bare bones class I could and keep getting odd errors.

Any ideas.. I really want to use this package.. it looks like the best thing available for this type of capability.

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of SortableTreeWithoutDndContext.

import React, { Component } from 'react';
// import SortableTree from 'react-sortable-tree';
import FileExplorerTheme from 'react-sortable-tree-theme-file-explorer';
import { SortableTreeWithoutDndContext as SortableTree } from 'react-sortable-tree';
export class QuestionTreeView extends Component {
constructor(props) {
super(props);

this.state = {
  treeData: [{ title: 'src/', children: [{ title: 'index.js' }] }],
};

}

render() {
return (

treeData={this.state.treeData}
onChange={treeData => this.setState({ treeData })}
theme={FileExplorerTheme}
/>

);
}
}
export default QuestionTreeView;

I just encountered the same thing as you on the latest release (2.5.0) so I rolled back to 2.3.0 because of this https://github.com/frontend-collective/react-sortable-tree/issues/429 and now its working again. Looks like an issue being sorted out at the moment.

yep! we're working it out!!

Great thank you!! looks like a very awesome package. I was able to get it working with 2.3 as suggest so will use that. Looking forward to the update!

Fixed in 2.6.0!

encountered again:

    "react": "^17.0.1",
    "react-dom": "^17.0.1",
    "react-scripts": "4.0.0",
    "react-sortable-tree": "^2.8.0",

See: https://github.com/frontend-collective/react-sortable-tree/issues/830

@wuweiweiwu is this being looked at? the same problem is happening in version 2.8.0 as @OR13 mentioned above

Was this page helpful?
0 / 5 - 0 ratings

Related issues

2503shubham picture 2503shubham  路  3Comments

oarashi picture oarashi  路  5Comments

29er picture 29er  路  5Comments

mhiggs picture mhiggs  路  3Comments

JonatanGarciaClavo picture JonatanGarciaClavo  路  3Comments