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

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