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

136
Vistas
React - Same prop name from parent component and context?

I came up with a mind-boggling situation, which did not (at least yet) cause any problems, but I couldn't find anything by googling.

A theoretical (and unrealistic but illustrative) example of two React Components:

// parent.js
import Child from "./path-to-child";

export function Parent(props) {
  return(
    <Child content="some content" />
  );
}
// child.js
import withContext from "./path-to-context";

function Child(props) {
  return(
    <p>
      {props.content}
    </p>
  );
}

export default withContext(Child);

So the Parent is passing content as a prop to Child. If the context provided by withContext HOC also happened to have a property with name content, what would happen? Is there an order of precedence or is content just the latest value which happens to overwrite the older one or perhaps something else?

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