Im trying to use Material UI's useMediaQuery to modify the styles of one of Material UI's component, which is the Button component. I am trying to remove the outline around the button when the screen shrinks. So I was trying to do this:
const mediumScreen = useMediaQuery(theme.breakpoints.down('md'));
<Button
name="discoverItems"
variant={mediumScreen ? '' : 'outlined'}
color="primary"
size="small"
>
Shop Here
</Button>
However, I am not using a functional component. Instead I am using a class component and it is throwing error:
TypeError: (0 , _core.useMediaQuery) is not a function
Is there any way I can achieve the goal without turning it into a functional component? Thanks!