We can derive type from a function like this.
const createPerson = () => ({
firstName: 'Yasunori',
lastName: 'Tanaka',
})
type Person = ReturnType<typeof createPerson>
And then, use that as Person
type.
We can derive type from a function like this.
const createPerson = () => ({
firstName: 'Yasunori',
lastName: 'Tanaka',
})
type Person = ReturnType<typeof createPerson>
And then, use that as Person
type.
For further actions, you may consider blocking this person and/or reporting abuse
Nandani Sharma -
Mauricio Aires -
Kannav Sethi -
Muhammad Awais -
Top comments (0)