minop1205 / react-dnd-treeview

A draggable / droppable React-based treeview component. You can use render props to create each node freely.
MIT License
519 stars 69 forks source link

Unable to use with AntDesign #159

Closed nosferatu500 closed 1 year ago

nosferatu500 commented 1 year ago

Describe the bug Crash when trying to use <Dropdown><CustomNode/></Dropdown> (Dropdown from AntDesign)

To Reproduce

Expected behavior Should render Dropdown without crashing app.

nosferatu500 commented 1 year ago

For anyone who face the same issue:

The issue will be fixed if wrap <CustomNode> with <div>

Example:

<Dropdown
    trigger={["contextMenu"]}
    overlay={buildMenu(node)}
>
<div>
    <CustomNode
    node={node}
    {...options}
    isSelected={selected}
    isDragging={selected && isDragging}
    onClick={handleClick}
    />
</div>
</Dropdown>