這可能是一個簡單的問題,但老實說我不知道??該怎么做
例如,我有一個TextInput來自 react native的自定義稱為CustomTextInput
它會有一個界面
export interface CustomTextInputI{
customPlaceHolder:string
style:ViewStyle
//etc
}
我用它喜歡
export const CustomTextInput =(props:CustomTextInputI)=>(
const {customPlaceHolder, style} = props
return(
<TextInput style={style}. etc />
)
)
并且像<CustomTextInput style customPlaceHolder/>
BUT一樣使用這個組件,如果我使用像 secureTextEntry 這樣的 textInput 道具,它不會接受(當然)所以我如何使用我的自定義道具 plus all props of TextInput。???
uj5u.com熱心網友回復:
應該管用:
import { TextInputProps } from 'react-native'
export interface CustomTextInputI extends TextInputProps {
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/367199.html
標籤:javascript 反应 反应原生
