score:2

you can export childprops, then in parent use indexed access operator to get the type of the foo prop:

const foo: childprops['foo'] = str => {
    console.log(str);
}

playground


or even without exporting child props type, you can use componentprops utility to get it:

import { componentprops } from 'react';

const foo: componentprops<typeof child>['foo'] = str => {
    console.log(str);
}

playground


Related Query

More Query from same tag