Lara
Lara

Reputation: 3021

How to expand all the grouping of table by default

I am trying to use material ui table with group by feature, As i was looking into the code, grouping can be expanded or shrinked using click event, however, i want to keep all expanded by default as soon as page component loads.

Below is codesandbox

How to achieve it?

Upvotes: 0

Views: 602

Answers (1)

Trace
Trace

Reputation: 18869

This should do it:

const [open, setOpen] = React.useState(true);

Upvotes: 1

Related Questions