【发布时间】:2019-01-28 09:36:15
【问题描述】:
目前我有 redux 和 stacknavigator,我想实现一个底部选项卡导航器。有了这个,我发现了tabnavigator,我不知道如何实现它们。这是我当前的 App.js:
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { createStackNavigator } from 'react-navigation';
import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings(['Warning: isMounted(...) is deprecated', 'Module RCTImageLoader']);
import store from './store'; //Import the store
import Home from './components/home' //Import the component file
import Cart from './components/cart';
import SearchResults from './components/searchResults';
export default class App extends Component {
render() {
return (
<Provider store={store}>
<Root />
</Provider>
);
}
}
const Root = createStackNavigator(
{
Home: {
screen: Home
},
Cart:{
screen: Cart
},
SearchResults:{
screen: SearchResults
}
},
{
initialRouteName: 'Home',
}
);
我需要使用 stacknavigator 来触发我的搜索按钮并从中传递数据,同时我正在使用 redux。在这种情况下,我是否也可以有一个底部标签导航器?
【问题讨论】:
标签: javascript reactjs react-native react-redux react-navigation