Quantcast
Channel: React Native passing functions with arguments as props - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by blaz for React Native passing functions with arguments as props

You did it correctly. MyComponent is as "dumb" as it should be: it does not care about the source of its props, it acts independently from higher level of logic of the app and it can be reused...

View Article



Answer by Incinerator for React Native passing functions with arguments as props

The proper syntax would be something like this: render () { let myId = 10; return <MyComponent myID={myId} onPress={() => this._onItemPress(myId)} /> } Also, if you plan to use this inside...

View Article

React Native passing functions with arguments as props

From what I have read its best to try and structure react apps with as many components as "dumb" renderers. You have your containers which fetch the data and pass it down to the components as props....

View Article
Browsing latest articles
Browse All 3 View Live




Latest Images