Answer the question
In order to leave comments, you need to log in
How to use breakpoints styled-components inside a React component?
Is there a similar media query entry in styled components like material ui?
const SimpleMediaQuery = () => {
const matches = useMediaQuery("(min-width:600px)");
if (matches) {
return (
<Paper elevation={5}>
<Box p={5}>SimpleMediaQuery breakpoint has a min width of 600px</Box>
</Paper>
);
}
return <></>;
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question