Opening modals after clicking specific image and pass data to that modal #33719
Unanswered
DennisKraaijeveld
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! Right now I am building a Instagram feed component to display my latest posts.
Link to the GIF to show how it looks like right now
Instagram Component
However, I do want to open up a modal after I click this image. Making that modal is no problem, but getting the right information displayed is. Since these are React components I can not pass ID variables and use a page query to get the information. I tried something with StaticQuery, but without any succes. What is a recommended way to pass the correct information to each modal?
The current structure:
Index.js
Here I pass all the data to my Feed Component, which then maps over the data and displays the images in a row
Feed Component
Hope somebody can get me in the right direction :) Thanks!
Beta Was this translation helpful? Give feedback.
All reactions