Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

134
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!