mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.55k stars 1.33k forks source link

[tree view] `groupTransition` slot prop doesn't accept transition props #15526

Closed cemreyavuz closed 1 day ago

cemreyavuz commented 1 day ago

Steps to reproduce

Steps:

  1. Open this link to live example: https://codesandbox.io/p/sandbox/sharp-river-xl9n2k
  2. Open Demo.tsx file
  3. Check L20-23

Current behavior

I cannot use transition props like enter and exit as part of slotProps.groupTransition for TreeView or TreeItem.

For TreeItem, it's typed as groupTransition?: SlotComponentProps<'div', {}, {}>;: https://github.com/mui/mui-x/blob/6e21fb6e34dbf60f01c24b089c4e2d4c19758647/packages/x-tree-view/src/TreeItem/TreeItem.types.ts#L56

It probably should be sth like groupTransition?: SlotComponentPropsFromProps<TransitionProps, {}, {}>; (at least this was working fine in older versions).

Expected behavior

I expect to use transition props like enter and exit as part of slotProps.groupTransition.

Context

No response

Your environment

"dependencies": {
    "@emotion/react": "latest",
    "@emotion/styled": "latest",
    "@mui/material": "latest",
    "@mui/x-tree-view": "8.0.0-alpha.0",
    "@types/react": "latest",
    "@types/react-dom": "latest",
    "react": "latest",
    "react-dom": "latest",
    "typescript": "latest"
  },

Search keywords: TreeView, TreeItem, groupTransition

michelengelen commented 1 day ago

Hey @cemreyavuz Thanks for opening this issue. I'll leave this one to @flaviendelangle as he is the master of types on the tree view components! 🥷

flaviendelangle commented 1 day ago

Indeed, I'll fix that :+1:

cemreyavuz commented 1 day ago

Thanks for the very swift response 🙌🏻

github-actions[bot] commented 1 day ago

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

[!NOTE] @cemreyavuz How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.