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

153
Views
How to inherit react component props in JavaScript?

I come to react (as well as react-native) with typescript, of course, I'm a beginner, so soon my company assigns me to support a javascript project, and I have javascript questions

In typescript, if we want to use props, I think the best, also cool way to do that is using Interface, it also let me have IntelliSense code in vs code

export interface FooI {
  some: string;
  propsA: string;
  here: number;
}

And use that in component:

export default function Bar(props: FooI) {
  const {some, propsA, here} = props;
}

And we also can inherit react component( in this case is react-native), so if I want the component will be a button, so I add

export interface FooI extends ButtonProps {
  some: string;
  propsA: string;
  here: number;
}

As I know we don't have that in javascript, so what is similar to the interface in javascript so I can create a custom component like above and vs code will recognize that and show an auto-complete pop-up?

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!