DrawerListItem#

This component extends ListItem component of material-ui. It also provide props for routing. See props.

Can't be used outside <Drawer>.

Example#

import { List, ListItemIcon, ListItemText } from '@material-ui/core';
import { DrawerListItem } from 'la-danze-ui';
function App() {
return (
...
<DrawerListItem to="/" exact title="Home">
<ListItemIcon>...</ListItemIcon>
<ListItemText primary="Home" />
</DrawerListItem>
...
);
}

Props#

Extends ListItem props

Additional props:

NameTypeDefaultRequiredDescription
titlestringNoThe title of the tooltip when drawer is closed.
tostringYesSee react-router-dom doc.
exactbooleanNoSee react-router-dom doc.
strictbooleanNoSee react-router-dom doc.
isActivefunctionNoSee react-router-dom doc.
(match: match%3CParams%3E | null, location: Location%3Cunknown%3E): boolean
onActivefunctionNoEvent fired when active state changes.
(active: boolean) => void
animationKeyAnimationKeyNoUse it only if you have nested routes. It will prevent parent route from re rendering.
noRefreshbooleanNoIf set to true it will prevent current route from refreshing on click.
safeOnClickfunctionNoOnclick event fired only when there is a route change by clicking on item. noRefresh must be true.
(event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void