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

131
Vistas
Why is my express react application not loading?

Why is it so difficult to post on here, everything I type in the title is not accepted so sorry it does not make sense.

Hello everyone! I'm having this error

Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:

  1. You might have mismatching versions of React and the renderer (such as React DOM)
  2. You might be breaking the Rules of Hooks
  3. You might have more than one copy of React in the same app See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.

This only seems to happen after I imported material-ui. Im pretty stumped. Here is my code.

import {Container, AppBar, Typography, Grow, Grid} from '@material-ui/core'
import bandmate from './images/bandmate.jpeg'

const App = ()=> {

    

    return (
        <Container maxidth = 'lg'>
            <AppBar position = 'static' color = 'inherit'>
                <Typography varaint = "h2" align = 'center'>BandMate</Typography>
                <img src= {bandmate} alt = 'bandmate' height= '60'/>
            </AppBar>
        </Container>
    );
}

export default App;



The solutions I have run into seem to reference webpack, I am not using webpack so I'm not sure where to go with that. I followed the link above and ran this code as instructed and it returned false, meaning I have a duplicate react issue

window.React1 = require('react');

// Add this in your component file
require('react-dom');
window.React2 = require('react');
console.log(window.React1 === window.React2);```




I've seen some people say to try npm link but I cant seem to get that to work either. I ran ```npm link ../myProjectName/client/node_modules/react``` Im not even sure if I am using npm link correctly, but I just get a ton of errors. All of the posts seem to point to this, but I either don't understand what I'm doing or its not the correct solution. 

Thank you all in advance for your help, I have been struggling with this for 2 days now with no progress.

Also I'm not sure what is up with my formatting, I thought you open and close with ``` ``` but I guess not.
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

After I posted this I just uninstalled all of my packages and reinstalled them and it fixed the problem.

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