如何在Redux中使用反应导航?
考虑我当前的代码:
import React from 'react';
import Home from './components/home';
import MyView from './components/view';
import Create from './components/create';
import {createStore,Provider} from 'redux';
import {createStackNavigator} from 'react-navigation';
import reducers from './reducer'
const Root = createStackNavigator({
Home:{screen:Home},
MyView:{screen:MyView},
Create:{screen:Create}
})
const store = createStore(reducers);
export default class App extends React.Component{
render(){
return(
//here when i remove provider error gone
<Provider store={store}>
<Root/>
</Provider>
)
}
}
我收到以下错误:
不变违规:元素类型无效:在带redux的反应导航中使用预期的字符串