How to save the current route?
Hello! How can i save the current route to go back to it after login? And what type i should use for that?
I'm trying to do like that:
```ts
import { Page } from '@nanostores/router'
class App {
requestedRoute: Page
}
const app = new App()
app.requestedRoute = $router.get()!
// ^^^^^^^^^^^^^^^^
// TSError: Type '{ params: {}; path: string; route: "login"; }' is not assignable to type '{ params: never; path: string; route: any; }
// Types of property 'params' are incompatible.
// Type '{}' is not assignable to type 'never'.ts(2322)
```
What am i doing wrong? Thanks!
关闭于 2024-02-14 2 条评论