Skip to content
Advertisement

Tag: react-table

Add new column on button click in React JS react-table

I need to add new column to react-table when button click, even after re-rendering table with flag Iam unable to add new column, can you please suggest on where am I gone wrong. Here is the executable sandbox code. https://codesandbox.io/s/tannerlinsley-react-table-row-selection-forked-3gcwm?file=/src/App.js Answer You need to keep a state for the columns and change it accordingly using the setter method. Try like

Advertisement