Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

156
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda