// Each list is defined with an unique ID and a title
constlists=[
{
listId:'1',
title:'List 1'
},
{
listId:'2',
title:'List 2'
},
{
listId:'3',
title:'List 3'
}
]
// Populate the board with random items
constinitialData:DataSource[]=[]
for(leti=0;i<10;i++){
initialData.push({
dataId:`${i}`,
listId:'1',// Each item is assign to a list with listId
render:<Item> Item {i}</Item>// The rendered component for the item, You can use any JSX
})
}
// CallBack function called when an item is drop
constonDataUpdate=(data:DataSource[])=>{
console.log(data)
}
return(
<>
{/* You can add style or className on Board for styling */}
<Board
lists={lists}
dataSource={initialData}
onDataUpdate={onDataUpdate}
/>
</>
)
}
Status
Under active development, not tested with large dataset (more than 200 items). For more flexible solution you should directly use react-dnd or react-beautiful-dnd