You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there,
we got a similar problem than #1436 (comment), even with the version 0.0.5 and Next 14/15. The solution to set reactStrictMode to false works fine but for production mode, set reactStrictMode to false is not good.
Below are the examples used with Next (not working) and Vite (working).
import{DragDropProvider}from'@dnd-kit/react';import{useSortable}from'@dnd-kit/react/sortable';import{move}from'@dnd-kit/helpers';conststyles={display: 'inline-flex',flexDirection: 'row',gap: 20};exportfunctionControlledExample({ it }){const[items,setItems]=useState([it]);if(!window)returnuseEffect(()=>{setItems(it)},[it])return(<DragDropProvideronDragEnd={event=>{setItems(items=>move(items,event.operation.source,event.operation.target));}}><divstyle={styles}>{items.map((id,index)=>(<Sortablekey={id}id={id}index={index}/>))}</div></DragDropProvider>);}functionSortable({ id, index }){const{ ref }=useSortable({ id, index });return<buttonref={ref}>Item {id}</button>;}
The text was updated successfully, but these errors were encountered:
Hi there,
we got a similar problem than #1436 (comment), even with the version 0.0.5 and Next 14/15. The solution to set reactStrictMode to false works fine but for production mode, set reactStrictMode to false is not good.
Below are the examples used with Next (not working) and Vite (working).
The text was updated successfully, but these errors were encountered: