We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'breakpoints' of null
The problems originate from this line
https://github.com/mui-org/material-ui-pickers/blob/0d41c48aaa8b9b6f67e72deee9583340cd218b89/lib/src/wrappers/ResponsiveWrapper.tsx#L27
For more details: mui/material-ui#16859
https://codesandbox.io/s/cranky-hamilton-130yq
The text was updated successfully, but these errors were encountered:
Thanks @oliviertassinari! AFAI we need to make our own custom version of this hook?
Sorry, something went wrong.
@dmtrKovalenko I propose this patch:
diff --git a/lib/src/wrappers/ResponsiveWrapper.tsx b/lib/src/wrappers/ResponsiveWrapper.tsx index adb9def4..c5e69dc3 100644 --- a/lib/src/wrappers/ResponsiveWrapper.tsx +++ b/lib/src/wrappers/ResponsiveWrapper.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Theme } from '@material-ui/core/styles'; +import { useTheme } from '@material-ui/core/styles'; import useMediaQuery from '@material-ui/core/useMediaQuery'; import { MobileWrapperProps, MobileWrapper } from './MobileWrapper'; import { DesktopWrapperProps, DesktopWrapper } from './DesktopWrapper'; @@ -24,7 +24,8 @@ export const ResponsiveWrapper: React.FC<ResponsiveWrapperProps> = ({ PopoverProps, ...other }) => { - const isDesktop = useMediaQuery<Theme>(theme => theme.breakpoints.up(desktopModeBreakpoint)); + const theme = useTheme(); + const isDesktop = useMediaQuery(theme.breakpoints.up(desktopModeBreakpoint)); return isDesktop ? ( <DesktopWrapper PopoverProps={PopoverProps} {...other} />
Successfully merging a pull request may close this issue.
The problems originate from this line
https://github.com/mui-org/material-ui-pickers/blob/0d41c48aaa8b9b6f67e72deee9583340cd218b89/lib/src/wrappers/ResponsiveWrapper.tsx#L27
For more details: mui/material-ui#16859
Environment
Steps to reproduce
https://codesandbox.io/s/cranky-hamilton-130yq
The text was updated successfully, but these errors were encountered: