techguybiswa / ferry-booking

MIT License
0 stars 0 forks source link

how will booking page know which activity user is booking for? #6

Open negati-ve opened 5 years ago

techguybiswa commented 5 years ago

As of now I am not sure about the exact workflow. But by my best guess, we do have the activity id in the list of activities page and also in the activity details page. We for sure are getting the activity id in the "list of activities" page. From there we can Pass state as props to the linked page as described in https://www.gatsbyjs.org/docs/gatsby-link/

negati-ve commented 5 years ago

Please demonstrate passing state by url/link with a simple example in your repo or test branch.. if it works we can go ahead with it

techguybiswa commented 5 years ago

Okay.. i am just testing it out and i am updating you in half an hour

techguybiswa commented 5 years ago

Yeah so passing of props via the use of Link in Gatsby works. For class based component we need to do : this.props.state.activityId as the activityId is passes as a prop in a state via Link.