Skip to content

How can I trigger a column to rerender based on an external state? #595

Closed Answered by hcheng-ae
hcheng-ae asked this question in Q&A
Discussion options

You must be logged in to vote

I just figured it out. It seems that in this case, I should use Cell instead of accessorFn. The following column defintion works for me:

  const columns = useMemo<MRT_ColumnDef<Person>[]>(() => {
    return [
      {
        accessorKey: 'name',
        header: 'Name',
      },
      {
        accessorKey: 'email',
        header: 'Email',
        Cell: ({ cell }) => `${cell.getValue<string>()} ${format}`,
      },
    ];
  }, [format]);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hcheng-ae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant