DEV Community

Discussion on: The power of custom hooks in React (responsive design example)

Collapse
 
d0m00re profile image
d0m00re

I use this kind of approach: (styled-components-approach)
const Flex = styled.div
js
@media ${(props) => props.theme.device.mobileL} {}
@media ${(props) => props.theme.device.laptop}{}
@media ${(props) => props.theme.device.desktop} {};

I combine that with styled components and style theme swiching (maintain multiple type of responsive with styled theme).
;

Collapse
 
theqwertypusher profile image
Jason Victor

This is interesting. I just started using styled-components and now figuring out how to handle responsiveness. Can you think of any drawbacks to your approach?