Tell me, please, how to use nodeContentRenderer correctly.
I want to wrap the NodeRendererDefault in ContextMenuTrigger.
My example:
...
import SortableTree, { toggleExpandedForAll, addNodeUnderParent, getNodeAtPath } from 'react-sortable-tree';
import { ContextMenu, MenuItem, SubMenu, ContextMenuTrigger } from 'react-contextmenu';
import NodeRendererDefault from './NodeRendererDefault.jsx';
...
<SortableTree
...
// "node" : I need rowInfo in the context menu items
nodeContentRenderer={({ node }) => (
<div>
<ContextMenuTrigger id={MENU_TYPE} holdToDisplay={300} collect={() => node}>
{ NodeRendererDefault }
</ContextMenuTrigger>
</div>
)}
...
>
...
The result is nothing rendered =(
I have already read these threads, but I did not find the answer to my question there:
https://github.com/frontend-collective/react-sortable-tree/issues/4
https://github.com/frontend-collective/react-sortable-tree/issues/135
Thanks in advance.
I hope my answer will help anyone who is struggling with nodeContentRenderer.
import CustomNodeContentRenderer from './CustomNodeContentRenderer';<SortableTree
nodeContentRenderer={CustomNodeContentRenderer}
/>
}To confirm if everything is working, just edit the JavaScript you created.
would be nice if this is part of the tutorial series. I will copy your instructions to create such a doc. Thanks @ytakayanagi
Most helpful comment
I hope my answer will help anyone who is struggling with nodeContentRenderer.
import CustomNodeContentRenderer from './CustomNodeContentRenderer';<SortableTree nodeContentRenderer={CustomNodeContentRenderer} /> }To confirm if everything is working, just edit the JavaScript you created.