Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store not updating on drag and drop when using useDragAndDrop hook with Redux Toolkit #56

Open
poojadosad opened this issue Apr 15, 2024 · 1 comment

Comments

@poojadosad
Copy link

When using the useDragAndDrop hook from your library in conjunction with Redux Toolkit, the Redux store is not updating after a drag and drop operation.

Here's how I used the hook.

const kanbanStore = useSelector((state: { kanbanReducer: KanbanType }) => state.kanbanReducer);
const dispatch = useDispatch();

const [boardRef, columns, setColumns] = useDragAndDrop(kanbanStore.columns, {
  plugins: [animations()],
  dragHandle: '.list-handle'
});

I expect the Redux store to update when a drag and drop operation is performed.

I'm using Next.js with React and Redux Toolkit for state management. The issue occurs when I try to drag and drop items on the Kanban board. The local state (columns) updates correctly, but the changes are not reflected in the Redux store.

Any help would be appreciated. Thanks!

@aarjithn
Copy link

Where are you using the dispatch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants