Reputation: 516
I have a top tab bar. Each tab has a stack navigator.
Dynamic navigator is here:
datas.forEach(function(data) {
const StackNavigator = createStackNavigator({
Home: HomePage
}, {
navigationOptions: {
title: data.headerTitle
}
});
tabs[data.headerTitle] = StackNavigator;
});
createMaterialTopTabNavigator(tabs, configs);
I want to pass data to HomePage. How can I do that? Below usage is not a valid syntax. I get below error:
Reference Error: Can't find variable React
Home: { screen : props => <HomePage {...props} {...value} /> }
Upvotes: 0
Views: 94
Reputation: 6742
Up in the top of your js file,
import React from 'react';
since you're using JSX in your js file, React
is needed.
Upvotes: 1