import {Button} from 'react-native';
const MyButton = (props: typeof Button) => {
return <Button title={props.title} onPress={props.onPress} style={{color:'#fff'}} />
}
import type {ComponentType} from 'react';
import {Button} from 'react-native';
type InferProps<Component> = Component extends ComponentType<infer Props> ? Props : never;
const MyButton = (props: InferProps<typeof Button>) => {
return <Button title={props.title} onPress={props.onPress} style={{color:'#fff'}} />
}