-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set an item onTap callback? #33
Comments
Hi there, You are in full control of the item you want to present in the grid. You can define your own TouchableOpacity in Similarly, delete functionality can be implemented on your end by adding a delete button and on clicking that you can remove the item from the items array. If this items is in your state and the same state variable is passed the grid as |
Thanks for you fast response. Already tried a TouchableOpacity around each item, it get triggered on initial render and never more.
Sorry I am just starting with react/native, it is probably me doing something wrong. Thanks you. |
Try onPress expects a function as the value. You are calling the function there, and onPress gets the return value from props.click and not the actual function. props.click is executed for each item when the component is rendered initially, which is why you saw the click results on first load (even without clicking the item I suppose). |
Thats works. It can bubble the click correctly now. |
Hello, many thanks for you work!
I have two questions:
how to set a item onTap callback?
Any chance to have add/del item functionality?
Thanks again.
The text was updated successfully, but these errors were encountered: