-
Notifications
You must be signed in to change notification settings - Fork 492
Open
Description
Describe the bug
Hello guys,
I have trouble with using react hook useEffect and useState. I'm using 'onCardClick' to catch the event 'click on card' and then i set state. But then i can drag anymore.
Can you tell me where the problem is? How can I use react hook with this library?
Here is my code:
function App() {
const [cardId, setCardId] = useState<string | null>(null);
const [dataDB, setDataDB] = useState<BoardData>(data);
// useEffect(() => {
// setDataDB(data);
// }, []);
const handleDataChange = (data: BoardData) => {
if (data !== undefined) setDataDB(data);
};
const handleClick = (cardId: string) => {
setCardId(cardId);
};
return (
<div>
<Board
onCardClick={handleClick}
onDataChange={handleDataChange}
editable
draggable
cardDraggable
data={dataDB}
/>
<Modal cardId={cardId} />
</div>
);
}Thank you!
Metadata
Metadata
Assignees
Labels
No labels