The Material-UI Box component allows us to reference other components as follows:
import Button from "@material-ui/core/Button";
import Box from "@material-ui/core/Box";
const NewButton = ({ children }) => (
<Box compoment={Button} px={3} py={1} color="white" bgcolor="primary.dark">
{children}
</Box>
)
This works just as I want it to. However, let me now try it with the Drawer component:
import Drawer from "@material-ui/core/Drawer";
import Box from "@material-ui/core/Box";
const NewDrawer = ({ children, open }) => {
return (
<Box component={Drawer} width="300px" bgcolor="secondary.dark">
{children}
</Box>
)
}
This does not work.
Any idea why not and how I can get it to work?
Thanks.