Fix drag-n-drop from a playlist, also fix useDrag memoization
This commit is contained in:
@@ -84,11 +84,14 @@ const ArtistFilter = (props) => {
|
||||
|
||||
const ArtistDatagridRow = (props) => {
|
||||
const { record } = props
|
||||
const [, dragArtistRef] = useDrag(() => ({
|
||||
type: DraggableTypes.ARTIST,
|
||||
item: { artistIds: [record?.id] },
|
||||
options: { dropEffect: 'copy' },
|
||||
}))
|
||||
const [, dragArtistRef] = useDrag(
|
||||
() => ({
|
||||
type: DraggableTypes.ARTIST,
|
||||
item: { artistIds: [record?.id] },
|
||||
options: { dropEffect: 'copy' },
|
||||
}),
|
||||
[record]
|
||||
)
|
||||
return <DatagridRow ref={dragArtistRef} {...props} />
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user