schultek / jaspr

Modern web framework for building websites in Dart. Supports SPAs, SSR and SSG.
https://jasprpad.schultek.de
MIT License
1.14k stars 68 forks source link

fix: jaspr_router calls onUnknownRoute before navigating to any route #83

Closed easazade closed 1 year ago

easazade commented 1 year ago

Description

I'm using jaspr_router and whenever I navigate to another page or whenever a page is loading, the component from onUknownRoute callback is shown.

Steps To Reproduce

@app
class App extends StatelessComponent with _$App {
  @override
  Iterable<Component> build(BuildContext context) sync* {
    yield Router(
      routes: [
        Route('/', (context) => [HomePage()]),
        Route('/about', (context) => [AboutPage()]),
      ],
      onUnknownRoute: (path, context) => NotFoundPage(),
    );
  }
}

https://user-images.githubusercontent.com/38987302/234523761-b4d109a0-f1a3-4598-9fc6-903a1f21ff90.mov

schultek commented 1 year ago

Closing this since the router package has been completely rewritten since the issue.