Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

220
Visualizações
React doesn't update when CSS File is changed

So I'm new to React. I want to style a simple text and found out how to use styles, but when I want to change something in the CSS I have to restart my React App which always takes 3 Minutes.

I use npm start to start the React server that was created with create-react-app.

How can I let React update when the CSS file is changed?


I have an index.js that looks like this:

import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import App from  './Frontend/App.js';
import './Frontend/style/main.css';

ReactDOM.render(<App/>, document.getElementById('root'));

And an App.js that looks like this:

import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import './style/main.css';

class App extends Component {
    render() {
        var pageHeading = (
            <h1 className="pageHeading">bosleeir.it</h1>);
        return pageHeading;
    }
}

export default App;
about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

Remember that you need to import your CSS in your component. I wouldn't recommend to do it on index.js

I'm assuming your folder structure is:

enter image description here

which could lead me that:

  1. You're using an older version of React
  2. You have modified the structure of your files

So double-check if the path are configured correctly.

about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda