Open piotrszczesniak opened 2 months ago
Just to note:
When using with Next.js 13 I implemented it this way - isMediumScreen is defined on the first render, otherwise it was defined on window width change:
import { breakpoints, mediaBreakPointDown } from './styles/MediaQueries'; import dynamic from 'next/dynamic'; const MediaQuery = dynamic(() => import('react-responsive'), { ssr: false, }); const Component = ({ props} : PropsType) => { return ( <MediaQuery query={mediaBreakPointDown(breakpoints.md)}> {(isMediumScreen: boolean) => ( // Your component code here, using isMediumScreen )} </MediaQuery> ); };
Want to add a nextjs section to the README as a PR?
Just to note:
When using with Next.js 13 I implemented it this way - isMediumScreen is defined on the first render, otherwise it was defined on window width change: