Instead of accessorKey you can also use accessorFn:(row) => row[key] if you are dynamically mapping the data
accessorKey
accessorFn:(row) => row[key]