So after building the complete web application, I've decided to make it mobile friendly. I'm using material ui framework with react. I read the documentation but am not sure as 2 how to use it. So let me give you an overview of what I think how to work it
Say I have this component
function App() {
const matches = useMediaQuery(theme.breakpoints.down('sm'));
return (
<Button variant="contained" color="primary">
</Button>
);
}
So if I wanna apply styles to button as per the breakpoint(in this case 'sm'), I'd do something like this:
...
<Button styles={{matches? mobileBtn : desktopBtn}}>
...
assumming I have defined mobileBtn and desktopBtn.
Is this the correct approach to use it, or is there some other standard way to do so. Although I don't think there is because if there was it would be included in the documentation.