I know that in the createMuiTheme() function you are able to update the values of the breakpoints like so.
const theme = createMuiTheme({
breakpoints: {
values: {
xs: 0,
sm: 600,
md: 960,
lg: 1280,
xl: 1920,
},
},
})
I also know that Material UI (relatively) recently changed it where you can add custom values for breakpoints.
breakpoints: {
values: {
tablet: 640,
laptop: 1024,
desktop: 1280,
},
},
});
However, I am using Typescript and I can't get it to work by overriding the breakpoint values as they explain here:
declare module "@material-ui/core/styles/createBreakpoints"
{
interface BreakpointOverrides
{
xs: false; // removes the `xs` breakpoint
sm: false;
md: false;
lg: false;
xl: false;
tablet: true; // adds the `tablet` breakpoint
laptop: true;
desktop: true;
}
}
and instead get this error
Type '{ tablet: number; laptop: number; desktop: number; }' is not assignable to type 'BreakpointValues'.
Object literal may only specify known properties, and 'tablet' does not exist in type 'BreakpointValues'.
Not sure what I am doing wrong? Any help would be appreciated.