patricktran / react-table-hoc-draggable-columns

ReactTable HOC for draggable columns
https://patricktran.github.io/react-table-hoc-draggable-columns/
MIT License
28 stars 24 forks source link

You call onDraggedColumnChange INSIDE a render -- big no no #19

Closed mrossner closed 4 years ago

mrossner commented 4 years ago

The whole point is this is supposed to be a callback that might cause state change and have you rerender the table (basically to make column order 'controlled and rememberable and changeable'). You call it inside a render() -- big no no

mrossner commented 4 years ago

OK I'll close myself -- my state should change in onDropSuccess, I get it now. I guess you could do some local recordkeeping (no setState or mobx or redux or anything in onDraggedColumnChange. Really onDropSuccess should just pass the new column definitions ---