i have a state that gets an array of objects
each object is in this form
{
unnacurate: false,
useless: false,
other: false,
otherValue: '',
name: item,
id: item,
action: 'none'
}
when i pass the state in the values the list works fine
<Reorder.Group axis="y" values={tagsList} onReorder={(e) => console.log('reorder', e)}>
the probleme is whenever i console log the e to check if the reorder works it appears always as an empty array
so whenver i do
<Reorder.Group axis="y" values={tagsList} onReorder={setTagsList}>
the list disappear
the items are rendered this way
{tagsList.map((tag: any) => (
<Reorder.Item
key={tag.it}
value={tag.name}>
<Box
sx={{
padding: '1rem 2rem',
border: '1px solid #ddd',
marginBottom: '0.5rem', ...
enter image description here
the list rendering
enter image description here
and here the e always an empty array
nb: when i make a state of string array it works fine but i need the state to be at that form
at first i tried the string array but it won’t be usefull in my case
also the state was origianlly an object containg some string value (articleId) and two arrays (oldTags — array of strings) and (newTags array of objects (the new form)) but since i couldn’t pass anything of this object i extracted the new array into a seperate state to try to work with