2
我是新的反应原生。我试图在发生错误时更改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>
这看起来不错,谢谢! –