Closed HughLK closed 2 years ago
I want to show some tips at the top of SortableTree when drag is starting. So I called setState in onDragStateChanged . But it seems not work . How can I fix this?
const [dragState, setDragState] = useState(false); <DragState draggingState={draggingState.current} /> <div> <SortableTree ... onDragStateChanged={({ isDragging, draggedNode }: OnDragStateChangedData) => { setDragState(isDragging); }} /> </div> function DragState(props) { return props.draggingState ? ( <div className="dragging-tip"> <span>tips...</span> </div>) : null }
Currently, I use "setTimtout" to setState.
I want to show some tips at the top of SortableTree when drag is starting. So I called setState in onDragStateChanged . But it seems not work . How can I fix this?