react-navigation:在每个屏幕中包含一个Component

时间:2017-09-13 21:23:51

标签: reactjs react-native react-navigation

我正在使用StackNavigator redux,如下所示。在我的所有屏幕中加入Component的最简洁方法是什么?我尝试将ComponentAppWithNavigationState添加到AppNavigator<Provider store={store}> <AppWithNavigationState /> </Provider> const AppNavigator = StackNavigator({ Login: { screen: Login }, Main: { screen: Main }, }, { headerMode: 'none', } }) const AppWithNavigationState = ({ dispatch, router }) => { return( <AppNavigator navigation={addNavigationHelpers({ dispatch, state: router })} /> ) }; const mapStateToProps = (state) => ({ state, }); export default connect(mapStateToProps)(AppWithNavigationState); 但没有运气。

kivy.properties.Clock

1 个答案:

答案 0 :(得分:2)

您可以尝试添加兄弟组件,而不是添加子组件。试试下面的例子。

示例

$query = new WP_Query( array( 'category_name' => 'featured','posts_per_page' => 1 ));