Hi! I'm creating a NextJS project using Mantine. When I define the theme inside _app.tsx I get no TS errors, however if I remove the theme into it's own file I get TS errors.
Works OK, no TS error:
export default function App({ Component, pageProps }: AppProps) {
return (
<MantineProvider
withGlobalStyles
withNormalizeCSS
theme={{
colorScheme: `dark`,
}}
>
<Component {...pageProps} />
</MantineProvider>
);
}
Has TS error:
_app.tsx:
import { MantineProvider } from "@mantine/core";
import type { AppProps } from "next/app";
import { theme } from "./theme";
export default function App({ Component, pageProps }: AppProps) {
return (
<MantineProvider withGlobalStyles withNormalizeCSS theme={theme}>
<Component {...pageProps} />
</MantineProvider>
);
}
theme.ts: export const theme = { colorScheme: `dark`, };
I don't know if the TS error itself is important, because when I remove the line it complains about it starts complaining about something else.