You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The defaultTreeItemRenderer in the @react-md/tree package does not currently provide the className and liClassName props on each item to the TreeItem which means custom styling does not work out of the box. This is really an issue since this is used in the @react-md/layout package and the navigation items cannot be styled right now.
Workaround
This can be worked around by implementing a custom getItemProps function on the Tree ( or treeProps for the Layout component`
The `defaultTreeItemRenderer` will now correctly pass the `className`
and `liClassName` attributes as props to the `TreeItem` by default. This
helps with overriding the default styles of when using the `Layout`'s
navigation tree.
Note: You'll still need to use the `getItemProps` prop if you want to
specify custom styles while the tree item is `active` (`selected` state)
Closes#920
Description
The
defaultTreeItemRenderer
in the@react-md/tree
package does not currently provide theclassName
andliClassName
props on each item to theTreeItem
which means custom styling does not work out of the box. This is really an issue since this is used in the@react-md/layout
package and the navigation items cannot be styled right now.Workaround
This can be worked around by implementing a custom
getItemProps
function on theTree
( ortreeProps
for theLayout
component`Codesandbox example: https://codesandbox.io/s/react-md-creating-a-layout-forked-y0i14?file=/src/Layout.tsx
The text was updated successfully, but these errors were encountered: