AlexxNB / tinro

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

Fallback route showing in wildcard routes #28

Closed guillemc closed 3 years ago

guillemc commented 3 years ago

In a structure like this:

<Route>  <!-- same as <Route path="/*"> -->
    <Route path="/"><h1>It is main page</h1></Route>
    <Route path="/books/*">
        <Route path="/"><Index /></Route>
        <Route path="/fiction"><Page /></Route>
        <Route path="/drama"><Page /></Route>
    </Route>
    <Route fallback><NotFound /></Route>
</Route>

Loading route "/books" also triggers the NotFound component (see the console log in this REPL).

In the site I'm developing, the NotFound is also visible briefly as a flash of content...

Is this intentional? I hoped the fallback route to only be loaded if there was no match from any previous route.

AlexxNB commented 3 years ago

Will check it out. Thanks.

AlexxNB commented 3 years ago

Works fine in 0.4.1.

guillemc commented 3 years ago

Yep, thanks a lot!