I was using redux with data strecture looks like this
mydata = {id:'1', name:'the name ishere", children:[{id:'0',name:'name",children:[...]}]}
later I convert my data structure to look like this
mydata = [{id:string, name:string, children:[]} ,{...}]
and of course, I change my code to suits this new structure, but I face tow problems after that
- the first problem is the component doesn't re-render after I use dispatch I even used a usestate inside the updating function in
tree.tsx line 17
just to rerender the component - the second problem is there is a function called
adding()
that don't work properly any more. - you can notice that by seeing
reducer.tsx line 88
where i console.log(state) and the logged state actually new state but in line134
the logged state is not not effected by theadding function
- codesnadbox
Top comments (0)