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
chintanonweb -
Trym Nilsen -
Ukeje Chukwuemeriwo Goodness -
Parth -
Top comments (0)