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

157
Vistas
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
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