T
TanStack3y ago
fair-rose

Use expanded with both initialState and state

state: { expanded: {} } overrides initialState: { expanded: true }
1 Reply
fair-rose
fair-roseOP3y ago
nvm. the following works:
const [expanded, setExpanded] = useState<ExpandedState>(
initialState?.expanded || state?.expanded || {},
);
const [expanded, setExpanded] = useState<ExpandedState>(
initialState?.expanded || state?.expanded || {},
);

Did you find this page helpful?