import * as React from 'react' ; import MaterialAppBar from '@material-ui/core/AppBar' ; import { IAppBarProps } from './AppBar.props' ; import { useStyles } from './AppBar.styles' ; see https export const AppBar = React . forwardRef < unknown , IAppBarProps > ( ( props , ref ) => { const customClasses = useStyles ( ) ; const { classes , elevation } = props ; const getElevation = ( ) => { const NO_ELEVATION = 0 ; const DEFAULT_ELEVATION = 2 ; if ( ! elevation && elevation !== NO_ELEVATION ) { return DEFAULT_ELEVATION ; } return elevation ; } ; return ( < MaterialAppBar { ... props } classes = { { ... customClasses , ... classes } } elevation = { getElevation ( ) } ref = { ref } / > ) ; } ) ; AppBar . displayName = 'AppBar' ; export default AppBar ;