Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

226
Vistas
ReactJS does not load

Hi im noob to reactJS so idk a lot about it.

I've just finished the Header on my project and now im working on the footer. The thing is that if I import the Footer in index.js when page refreshes it doesn't load.

My index.js looks like this:

import React from 'react';
import ReactDOM from 'react-dom';

//Components
import Header from './component/header/Header';
import Footer from './component/footer/Footer';

//SCSS
import './index.scss';
import './custom.scss';

const app = (

  <div>
    <Header />

    <Footer />
  </div>

);

ReactDOM.render(
  app,
  document.getElementById('root')
);

I've tried to update node and react, upgrade the amount of memory in the package.json but none of this works...

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

The component should be a function and it should capitalized like

const App = () => (
 <div>
    <Header />
    <Footer />
  </div>
);

And then you should initiate your application like

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

About the naming of components check this section of the documentation

https://reactjs.org/docs/components-and-props.html#rendering-a-component

In particular, this is why it is important to use capitalized names for your components (from React ducumentation)

Note: Always start component names with a capital letter. React treats components starting with lowercase letters as DOM tags. For example, represents an HTML div tag, but represents a component and requires Welcome to be in scope.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Okay i've changed it but still doesnt work. When I start with -npm start- it show this for a couple of seconds

PS H:\...\hardysoft> npm start

> hardysoft@0.1.0 start
> react-scripts --max_old_space_size=4096 start

(node:14928) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
(Use `node --trace-deprecation ...' to show where the warning was created)
(node:14928) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
about 4 years ago · Juan Pablo Isaza Denunciar

0

Your syntax isn't correct

import React from 'react';
import ReactDOM from 'react-dom';

//Components
import Header from './component/header/Header';
import Footer from './component/footer/Footer';

//SCSS
import './index.scss';
import './custom.scss';

const App = () => {
  return(
    <div>
    <Header />
    <Footer />
    <div>
  )
}

ReactDOM.render(
  <App />,
  document.getElementById('root')
);
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda