score:2

Accepted answer

depends how much of childprops you want to reuse.

if you want to reuse just a couple of properties, you can use in indexed type query to get the type of a specific property:

interface parentprops {
    onchange: childprops['onchange']
}

or you can define parentprops to extend childprops if you want to reuse all properties:

interface parentprops extends childprops {
}

or you can pick just a subset using pick:

interface parentprops extends pick<childprops, 'onchange'>  { // pick<childprops, 'onchange' | 'label'> to pick more
}

or if you want to pick all except a subset you can use omit

interface parentprops extends omit<childprops, 'label'>  { // omit<childprops, 'onchange' | 'label'> to omit more
}

Related Query

More Query from same tag