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
hayata-yamamoto -
Dharmen Shah -
Oluwatobiloba Emmanuel -
Jagroop Singh -
Top comments (0)