How to pass props in StackNavigator

ساخت وبلاگ

آخرین مطالب

امکانات وب

Vote count: 0

const MainNavigator = StackNavigator({
  Home: {
    screen: Tabs
  },

  Collection_Products : {
    screen : Collection_Products,
    navigationOptions :  ({ navigation }) => ({

      title : `${navigation.state.params.name.toUpperCase()}`
    }),
  },

  MainProduct : {
    screen : (props) => ,
  },

});


export default class MainNav extends React.Component {
  constructor() {
    super();
    this.state = {
      checkout: { lineItems: { edges: [] } }
    };

  }

 method1 = (args) => {

}
  render() {

    return (
      
       
      
    );
  }
}

I am using react native to build application. I want to pass method 1 to different child components. How can I pass method1 function in MainProduct Component? With the syntax I am using I am only able to pass navigator props to child components.

asked 52 secs ago
hitarth

...
نویسنده : استخدام کار بازدید : 27 تاريخ : شنبه 1 ارديبهشت 1397 ساعت: 7:25

close
تبلیغات در اینترنت