const matches = useMediaQuery('(max-width:600px)'); return ( <> <Box className='innerSection'> {matches ? // Some Code : // Some Code </Box> } </> Ternary operator in react for Responsive Using MUI