Create React App was deprecated in early 2023 (comment from maintainers). It is not recommended to use it for new projects. It is recommended to use Vite or Next.js instead. Starting from version 7.0 some of Mantine styling features are not officially supported in Create React App.
If you want to build a single page application, use Vite instead:
To compile styles as shown in documentation, postcss-preset-mantine is required. Create React App does not support custom PostCSS configuration by default.
The easiest way to use Mantine with Create React App is to write styles in plain CSS without postcss-preset-mantine.
em function and CSS nesting:
If you still want to use postcss-preset-mantine with Create React App, you can eject your application and add custom PostCSS configuration.
- Eject your application –
npm run eject
- Install dependencies –
yarn add postcss postcss-preset-mantine @mantine/core @mantine/hooks
postcss.config.jsfile in the root of your project with the following content:
config/webpack.config.jswith the following:
- After that follow Vite getting started guide except for the first step
(you already have
You can find an example repository with ejected CRA application and full setup here.