The type definition for this function says "Hey, i need to be passed a string in order to do my job":
const onChangeInputText = (text: string) => setText(text);
But the definition for the onChangeText prop says "I'm not going to pass anything to you":
type Props = {
onChangeText: () => void;
text?: string;
};
Your code will actually pass a string through, so you should just need to update the type on the prop.
type Props = {
onChangeText: (val: string) => void;
text?: string;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…