Closed gasperz closed 9 years ago
hey there @gasperz, could you paste some sample code here? It would help me to figure out how to solve your problem :smile:
Actually I managed to solve this issue. I think that my problem was that I was missing .bind on my function call. So totally newbie problem. :). Anyhow. Link to my example.
Thanks
Ah yes @gasperz - it's necessary to do bind
if you use the extends
syntax for a React component :smile: glad you figured it out
One more question. On Main component (that is used as initial route on NavigatorIOS) I have ListView. On modal component I am using button (TouchableHighlight) and onPress I would like to add new item and push that to ListView on Main component. If I understand right I would need to have props on Main component (that would represent items) and use that as ListView dataSource. But how can I push(add) props to Main component in this example. Or am I doing it completely wrong?
@gasperz - this seems like a pretty common pattern, should be no different than what you would do to add items to a todo list :smile: check out some examples for that type of thing, eg: http://jsfiddle.net/johnthethird/NXCyC/7/
I eventually succeeded. For me it this example was very helpful. Thank you very much.
great! :smile:
For example for adding new items and similar. I was actually able to display buttons (TouchableHighlight), text inputs, text components. But have problem when I want to do something on button press. function is executed immediately when app starts and not when i press button. Any ideas? Thank you!