pancakeswap / pancake-toolkit

:hammer_and_pick: Pancake frontend packages
https://pancakeswap-uikit.netlify.app/
GNU General Public License v3.0
305 stars 755 forks source link

useModal is incompatible with react router links #312

Open Chef-Cheems opened 2 years ago

Chef-Cheems commented 2 years ago

If you want to put Link inside modal in useModal it doesn't work since modals are rendered outside of router provider. We need to find a solution to be able to use react router links in modals, otherwise we forcing users to reload the site / open a new tab.

tzoeov commented 2 years ago

Hey! You can import history from routerHistory.ts and just use history.push(..)