答案 0 :(得分:0)
可能是您尝试过{flex,... anotherProp} ...使用新的EcmaScript,您可以通过以下方式分配一个道具
let flex = 1
//and
let myObj = {flex} //outs=> {flex: 1} // the thing is that you might be writing wrong the props of your object, and or missing ","
答案 1 :(得分:0)
您似乎正在尝试使用类似于CSS的flex。在React Native中编写样式时,必须在前面加上引号。像这样:
display: "flex", justifyContent: "center", alignItems: "center"