davidmfoley / react-router-modal

Simple modals for react-router 4
MIT License
153 stars 20 forks source link

Once modal is closed the previous URL parameter is reset #8

Closed 01Kuzma closed 6 years ago

01Kuzma commented 6 years ago

Hi there! I've made a simple routing system which handles the language param in a URL. So if I type website.com/xx - > the appropriate language will be loaded. website.com will load a default language. Pretty straightforward logic.

If I type website.com/en/modal1 the modal1 will be opened with English translation, what is good, But the problem comes when I close the modal. The URL website.com/en/modal1 is reset to website.com without language parameter.

Is there a way to keep the URL parameter once the modal will be closed? Or it should be a new feature?

Thanks!

rscotten commented 6 years ago

maybe set parentPath='website.com/en' in the Modal or ModalRoute component?