I am using material ui version 5, i have a custom theme which i have wrapped in all my components around.
In one of my components i am trying to give paper some padding based on my theme, however i get the following error.
Property 'spacing' does not exist on type 'DefaultTheme'
<AppProvider>
<Theme>
<Layout>
<ProtectedRoute>
<Component {...pageProps} />
</ProtectedRoute>
</Layout>
</Theme>
</AppProvider>
campaign.tsx
const useStyles = makeStyles((theme) => ({
paper: {
padding: theme.spacing(3),
},
}));
export default function Campaign(props: ICampaginProps): ReactElement | null {
const classes = useStyles();
theme.tsx
const DEFAULT_THEME = createTheme({
typography: {
fontSize: 12,
},
palette: {
mode: "light",
primary: {
main: "#212121",
},
secondary: {
main: "#fafafa",
},
},
});