AlexxNB / tinro

Highly declarative, tiny, dependency free router for Svelte's web applications.
MIT License
669 stars 30 forks source link

Fallback component being destroyed and re-mounted #116

Open hagai-reuveni opened 1 year ago

hagai-reuveni commented 1 year ago

Hey, First of all - THANKS. This is a wonderful project.

Regarding my issue/question: I have an application where, if the route does not match any route, I need to show an iframe. The problem I have is that on every route change, the fallback component is first destroyed and then re-mounted. even if the previous and next route should fall back to the same component.

  1. Is there a way to have that fallback component be destroyed only if it's not needed anymore?
  2. Is there a way to use the "isMatch" function directly so I can check if any of my routes match and if not have my own logic? (somthing like react-router's matchPath utility)

Thanks again, H.