我正在使用StackNavigator
redux
,如下所示。在我的所有屏幕中加入Component
的最简洁方法是什么?我尝试将Component
和AppWithNavigationState
添加到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
答案 0 :(得分:2)
您可以尝试添加兄弟组件,而不是添加子组件。试试下面的例子。
示例强>
$query = new WP_Query( array( 'category_name' => 'featured','posts_per_page' => 1 ));