react: "16.11.0",
react-native: "0.62.2",
react-native-navigation: "^6.4.0",
react-native-tab-view: "^2.14.0",
我正在尝试将react-native-tab-view与react-native-navigation V3 一起使用。
到目前为止,我能够以这种方式使用注册组件:
import EventsScreen from './EventsScreen';
function registerScreens()
{
...
Navigation.registerComponent('com.events.EventsScreen', () => gestureHandlerRootHOC(EventsScreen));
...
}
在React.Component
我想要标签视图的页面中:
import EventsScreen from './EventsScreen';
let renderScene = SceneMap({
first: EventsScreen,
second: AddEventScreen });
上述方式有效,但我无法将任何道具传递给 EventsScreen。我更有可能期待这样的设计,
{
component: 'com.events.EventsScreen',
passProps: { .. }
}
如果我以这种方式尝试,以下不起作用:
let renderScene = SceneMap({
first: 'com.events.EventsScreen',
second: 'com.events.AddEventScreen' });
使用道具提供React.Component
视图的正确方法是什么?SceneMap