The problem in depth
Hello 👋
I'm trying to add a data-testid to the items of a RichTreeViewPro, but running into type errors:
<RichTreeViewPro
items={ITEMS}
slotProps={{
item: ( item ) => ({
'data-testid': item.itemId,
}),
}}
/>
The above code works, but has a type error on item because data-testid isn't a part of TreeItemProps
Is there a better way to add a test id to RichTreeViewPro items or would it be possible to expand the typing on slotProps.item so that it can be added there without type issues?
Thank you!
Your environment
See codesandbox: https://stackblitz.com/edit/m14vsgsd?file=src%2FDemo.tsx
Search keywords: RichTreeView test id item
Order ID: 82849
The problem in depth
Hello 👋
I'm trying to add a data-testid to the items of a
RichTreeViewPro, but running into type errors:The above code works, but has a type error on
itembecausedata-testidisn't a part ofTreeItemPropsIs there a better way to add a test id to RichTreeViewPro items or would it be possible to expand the typing on
slotProps.itemso that it can be added there without type issues?Thank you!
Your environment
See codesandbox: https://stackblitz.com/edit/m14vsgsd?file=src%2FDemo.tsx
Search keywords: RichTreeView test id item
Order ID: 82849