M
M
Maxim Korolsky2017-03-11 19:50:40
React
Maxim Korolsky, 2017-03-11 19:50:40

How to organize a router in an application with modal windows?

Ladies and gentlemen, there is an application for a couple of dozen pages
. The bottom line is that half of these pages are modal windows that open on top of the page on which it was opened.
The question is how to organize routing.
Modal windows must have their own url, and if they navigated through it without a history, then the base page opens with a window on top
. That is, there is a notes page, a note was opened in it, the modal opened on top of the notes page.
The same note should be able to be opened on the profile page on top of the profile page.
And on top of a couple more pages.
In both variants, the route is one
site / note / 123
When closing by history, return to the previous one, otherwise to the base
Perhaps someone has come across and can push in the right direction, the options that came to my mind are a lot of repetitive code. Perhaps there is something simpler, maybe some kind of package is ready.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2017-03-11
@xmoonlight

This is usually done via a hash tag:сайт/заметка/123#modal/aaa/bbb/ccc

D
davidnum95, 2017-03-13
@davidnum95

And what is the difficulty?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question