I’m having a lot of fun building my first Meteor/React project. I was wondering if there is a way to create a direct link to a modal?
At the moment I have 3 pages which all have their own modals. I would like to create something like www.page.com/comments/modalId. So when people click on the link they are immediatly brought to the specific modal.
I am using react-router for the routing in my app but to be honest I would have no idea how to achieve this, if it’s even possible.
If your modal show and hide with state, then it seems that if it is initially in show state on the link then it will be already showing up when someone visits the link.
I have been looking into doing something similar. Not sure if this will be helpful, but something I found is https://github.com/tajo/react-portal. This allows you to manage a separate react root, with a use case being modals. I haven’t worked with it much yet, but I imagine you can do something with a specific route that would hide/show a modal using this.
Cool thanks so much for taking the time to reply. I am going to check it out! I know it’s possible, I read that you can actually change the state of a component directly via the link, haven’t found out how yet though