美文网首页
react-native redux 集成的一些坑

react-native redux 集成的一些坑

作者: 生光 | 来源:发表于2017-02-27 10:29 被阅读213次
  1. react版本不同,控件的位置也不同,导致undefined
    super expression must either be null or a function, not undefined
老版本:
import React, {
  Component
} from 'react-native'
新版本:
import React,{ 
  Component
} from 'react';
  1. redux
老版本:
import { Provider } from 'react-redux/native';
新版本
import { Provider } from 'react-redux';
  1. 巨坑..onlyChild must be passed a children with exactly one child
老版本:
<Provider store={store}>
            {() => <App />}
            </Provider>
新版本:
<Provider store={store}>
            <App />
            </Provider>

网上很多解决办法集中在Touchable开头的组件,其实是原因在provider的child。

相关文章

网友评论

      本文标题:react-native redux 集成的一些坑

      本文链接:https://www.haomeiwen.com/subject/yombwttx.html