@@ -24,6 +24,7 @@ export interface NavigationTreeNodeProps {
2424 children ?: React . ReactNode ;
2525 onActivate ?: ( path : string ) => void ;
2626 getActions ?: NavigationTreeProps [ 'getActions' ] ;
27+ renderAdditionalNodeElements ?: NavigationTreeProps [ 'renderAdditionalNodeElements' ] ;
2728 cache ?: boolean ;
2829}
2930
@@ -62,6 +63,7 @@ export function NavigationTreeNode({
6263 children,
6364 onActivate,
6465 getActions,
66+ renderAdditionalNodeElements,
6567 cache,
6668} : NavigationTreeNodeProps ) {
6769 const nodeState = state [ path ] ;
@@ -112,6 +114,10 @@ export function NavigationTreeNode({
112114 dispatch ( { type : NavigationTreeActionType . ToggleCollapsed , payload : { path} } ) ;
113115 } , [ ] ) ;
114116
117+ const additionalNodeElements = React . useMemo ( ( ) => {
118+ return renderAdditionalNodeElements ?.( nodeState . path , nodeState . type ) ;
119+ } , [ renderAdditionalNodeElements , nodeState ] ) ;
120+
115121 const actions = React . useMemo ( ( ) => {
116122 return getActions ?.( nodeState . path , nodeState . type ) ;
117123 } , [ getActions , nodeState ] ) ;
@@ -123,6 +129,7 @@ export function NavigationTreeNode({
123129 collapsed = { nodeState . collapsed }
124130 active = { nodeState . path === activePath }
125131 actions = { actions }
132+ additionalNodeElements = { additionalNodeElements }
126133 hasArrow = { nodeState . expandable }
127134 onClick = { handleClick }
128135 onArrowClick = { handleArrowClick }
0 commit comments