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.