-
-
Notifications
You must be signed in to change notification settings - Fork 295
Open
Description
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>
);
};
mcmuchenje
Metadata
Metadata
Assignees
Labels
No labels