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

150
Views
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
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!