最佳答案
我是第一次使用本机操作。当出现错误时,我试图更改 TextInput 的样式。
我怎样才能使我的代码不那么丑陋呢?
<TextInput
style={touched && invalid?
{height: 40, backgroundColor: 'white', borderRadius: 5, padding: 10, borderWidth: 2, borderColor: 'red'} :
{height: 40, backgroundColor: 'white', borderRadius: 5, padding: 10}}
</TextInput>