Skip to content

Commit 72608f5

Browse files
[TreeView] Add TransitionProps support
1 parent 25f948c commit 72608f5

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

docs/pages/api/tree-item.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
3333
| <span class="prop-name">label</span> | <span class="prop-type">node</span> | | The tree node label. |
3434
| <span class="prop-name required">nodeId&nbsp;*</span> | <span class="prop-type">string</span> | | The id of the node. |
3535
| <span class="prop-name">TransitionComponent</span> | <span class="prop-type">elementType</span> | <span class="prop-default">Collapse</span> | The component used for the transition. [Follow this guide](/components/transitions/#transitioncomponent-prop) to learn more about the requirements for this component. |
36+
| <span class="prop-name">TransitionProps</span> | <span class="prop-type">object</span> | | Props applied to the [`Transition`](http://reactcommunity.org/react-transition-group/transition#Transition-props) element. |
3637

3738
The `ref` is forwarded to the root element.
3839

packages/material-ui-lab/src/TreeItem/TreeItem.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ export interface TreeItemProps
3333
* [Follow this guide](/components/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
3434
*/
3535
TransitionComponent?: React.ComponentType<TransitionProps>;
36+
/**
37+
* Props applied to the [`Transition`](http://reactcommunity.org/react-transition-group/transition#Transition-props) element.
38+
*/
39+
TransitionProps?: TransitionProps;
3640
}
3741

3842
export type TreeItemClassKey =

packages/material-ui-lab/src/TreeItem/TreeItem.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const TreeItem = React.forwardRef(function TreeItem(props, ref) {
7070
onFocus,
7171
onKeyDown,
7272
TransitionComponent = Collapse,
73+
TransitionProps,
7374
...other
7475
} = props;
7576

@@ -298,6 +299,7 @@ const TreeItem = React.forwardRef(function TreeItem(props, ref) {
298299
in={expanded}
299300
component="ul"
300301
role="group"
302+
{...TransitionProps}
301303
>
302304
{children}
303305
</TransitionComponent>
@@ -365,6 +367,10 @@ TreeItem.propTypes = {
365367
* [Follow this guide](/components/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
366368
*/
367369
TransitionComponent: PropTypes.elementType,
370+
/**
371+
* Props applied to the [`Transition`](http://reactcommunity.org/react-transition-group/transition#Transition-props) element.
372+
*/
373+
TransitionProps: PropTypes.object,
368374
};
369375

370376
export default withStyles(styles, { name: 'MuiTreeItem' })(TreeItem);

0 commit comments

Comments
 (0)