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

144
Visualizações
Creating an object from a custom type in typescript

I have made this type in typescript and I want to use it to construct objects but I am getting confused and the only way have been able to make an object is by passing it through as a parameter of a function I am not really too sure how to make a constructor or my type.

export type UserIdType = {
  userId: string;
  email?: string;
  title?: string;}

The only way I have been able to make an object is like this


const PersonalDetails = ({navigation}: Props,userId:UserIdType) => {

  userId.userId

what is the correct way for me to make an object using a custom type I just want to make a default object that just has default values of each of the types in the type.

about 4 years ago · Santiago Gelvez
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