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

365
Vistas
Warning: Cannot update a component (`ForwardRef`) while rendering a different component (`Parent`). To locate the bad setState() call inside `Parent`,

I have two different setStates in parent component

 const [ isVisible, setIsVisible ] = useState(false);
 const [ validImagePath, setValidImagePath ] = useState(null);

also has handle functions in parent

const handleVisibility = bool => setIsVisible(true);
const handleImagePath = path => setImagePath(path);

that parent has two child components

<Child1 handleVisibility={handleVisibility} isVisible={isVisible}/> 
<Child2 validImagePath={validImagePath} handleVisibility={handleVisibility} isVisible={isVisible} />

When parent component is rendered then is visible and onClick it sets a state that it renders <Child 2/>. Everything works fine but I get this warning: Warning: Cannot update a component (ForwardRef) while rendering a different component (Parent). To locate the bad setState() call inside Parent, follow the stack trace as described in https://reactjs.org/link/setstate-in-render.

Please help in resolving this warning.

about 4 years ago · Juan Pablo Isaza
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