Closed MrNiceRicee closed 1 month ago
Hello there!
I was wondering the choice for the drag preview to use ReactDom.render() instead of the ReactDom.createRoot().render()
ReactDom.render()
ReactDom.createRoot().render()
got a warning in react that it'll run in react 17 instead of react 18
// in the docs setCustomNativeDragPreview({ render({ container }) { ReactDOM.render(<Preview item={item} />, container); return function cleanup() { ReactDOM.unmountComponentAtNode(container); }; }, nativeSetDragImage, });
vs
setCustomNativeDragPreview({ render: ({ container }) => { const root = ReactDOM.createRoot(container); root.render(<Preview item={item} />); return () => root.unmount(); }, nativeSetDragImage, });
thank you again for making a great tool!
Either approach is fine. But you will most likely want to use a portal 😇
Hello there!
I was wondering the choice for the drag preview to use
ReactDom.render()
instead of theReactDom.createRoot().render()
got a warning in react that it'll run in react 17 instead of react 18
vs
thank you again for making a great tool!