reactNative react.children.only expected to receive a single react element child.问题

来源:互联网 发布:js encode 编辑:程序博客网 时间:2024/06/06 05:04

这个是因为使用了 TouchableWithoutFeedback,这个组件必须至少有一个child,如果是多个组件,必须以view来包装。

render() {  return(      <TouchableWithoutFeedback style={{flex: 1}} onPress={dismissKeyboard}>            <View style={{flex: 1}}>      。。。。。。。。。。
    </View>    </TouchableWithoutFeedback>  );}

这样就可以了。

0 0
原创粉丝点击