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

340
Vistas
How to solve Invalid Hook Call error when using Material UI?

I'm new at coding and I'm having the following error when adding a MaterialUI Icon

import PersonIcon from '@mui/icons-material/Person';


function Header() {
    return (

<div>
<PersonIcon />
<h2>Header file</h2>



</div>

    );
}

export default Header;


When adding I get the following error:

Console Error when adding

Please notice that I have installed MaterialUI Core and also MaterialUI Icons When not adding everything works fine

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

0

Try this

npm uninstall @material-ui/core @material-ui/icons

Then

npm i @material-ui/core @material-ui/icons

Restart the React server

npm start
// OR
yarn start

Let me know if it works, Good Luck

about 4 years ago · Juan Pablo Isaza Denunciar

0

You need to wrap your app in ThemeProvider:

index.js:

import * as React from 'react';
import ReactDOM from 'react-dom';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import App from './App';

const theme = createTheme({
  palette: {
    primary: {
      main: '#556cd6',
    },
    secondary: {
      main: '#19857b',
    },
  },
});


ReactDOM.render(
  <ThemeProvider theme={theme}>
    <App />
  </ThemeProvider>,
  document.querySelector('#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