Argument of type '{ firstName: string | null; lastName: string | null; username: string; photo: string; }' is not assignable to parameter
praveshtiwari150 opened this issue · comments
Argument of type '{ firstName: string | null; lastName: string | null; username: string; photo: string; }' is not assignable to parameter of type 'UpdateUserParams'.
Types of property 'firstName' are incompatible.
Type 'string | null' is not assignable to type 'string'.
Type 'null' is not assignable to type 'string'.ts(2345)
Just navigate to index.d.ts in types folder
and do these changes (add a ?)
declare type CreateUserParams = {
clerkId: string?;
email: string?;
username: string?;
firstName: string?;
lastName: string?;
photo: string?;
};
declare type UpdateUserParams = {
firstName: string?;
lastName: string?;
username: string?;
photo: string?;
};
declare type UpdateUserParams = {
firstName: string | null; // Allow null values for firstName
lastName: string | null;
username: string; // Still required
photo: string;
};
This might work..!