Hey all, I ran into the same problem:
I have index.js which contains this code:
import React from 'react';
import { render } from 'react-dom';
import App from './App.js';
import 'bootstrap/dist/css/bootstrap.css';
render(
document.querySelector('#app')
);
In the component App.js
I have import a different style, for example
import './styles/button.css';
The problem is that in the final build of the css file, my button.css is before bootstrap.css
How can I change priority? Thanks in advance for the help
I solved this problem. To resolve this, you need to attach a stylesheet before you import the App component
@codefln Attach a stylesheet how? Do you mean add it to the index.html?
@bondz No, I used import styles in .jsx
Correct, css is ordered by the order they're imported (top-down). The imports happen depth-first, not breadth-first.
Most helpful comment
I solved this problem. To resolve this, you need to attach a stylesheet before you import the App component