TanStackT
TanStackโ€ข2y agoโ€ข
3 replies
verbal-lime

autoResetExpanded does not work as expected

Hey ๐Ÿ‘‹๐Ÿฝ @Tanner Linsley @KevinVandy
autoResetExpanded should work in such a way that the expanding state is reset on a data change, right? I tried that, but it does not work. The data changes, but the expanded state remains. There's much confusion in the web about how to achieve a auto-reset of the expanded state in tanstack-table v8.

The only way I can manage the expand-reset so far is the following:
  useEffect(() => {
    table.resetExpanded();
  }, [data]);

Is this the right way? If yes, what's the purpose of https://tanstack.com/table/latest/docs/api/features/expanding#autoresetexpanded
Thanks
Was this page helpful?