我是个新来的土生土长的人.我试图在出现错误时更改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>