3

(Beginner here) I have a react project created with create-react-app, in a module I am importing rsuite (v5) components and styles as following:

import 'rsuite/dist/rsuite.min.css';
import { DateRangePicker, InputPicker } from 'rsuite';

but rsuite overrides my css globally.

I tried to import styles individually

import 'rsuite/DateRangePicker/styles/index.less';
import 'rsuite/InputPicker/styles/index.less';

but nothing happens.

How can I prevent rsuite from overriding my css ?

KThiseas
  • 31
  • 2
  • I tried using modularised imports with React Suite v4 but no styles are being applied: `import 'rsuite/lib/DateRangePicker/styles'; import 'rsuite/lib/InputPicker/styles'; import DateRangePicker from 'rsuite/lib/DateRangePicker'; import InputPicker from 'rsuite/lib/InputPicker';` – KThiseas Dec 07 '22 at 00:20

1 Answers1

1

A simple way to solve this issue in rsuite v5

import "rsuite/dist/rsuite-no-reset.min.css"; 

instead of

import 'rsuite/dist/rsuite.min.css';
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129