Control accessor dynamic based on changing react state?

Is it possible for the value shown in a column to be dynamic based on react state? I have a user controllable filter and I want to pull different values from my row based on what is selected. Tried this but didn't work. It works on load but not when the state changes. buyOrRent is a useState variable.

    columnHelper.accessor((row) => {
      return row.price[buyOrRent].max;
    }, {
Was this page helpful?