https://github.com/cobypear/repro-no-router
https://github.com/cobypear/repro-no-router
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cobypear/repro-no-router
- Owner: CobyPear
- Created: 2023-05-22T16:10:45.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-24T16:05:39.000Z (about 3 years ago)
- Last Synced: 2024-12-30T09:31:15.739Z (over 1 year ago)
- Language: TypeScript
- Size: 48.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Expected
1. the `Go Back` button on the homepage works (it should use `router.back()` to navigate to the previous page)
2. The paginator should use shallow routing to change the URL when changing pages with the buttons
## Actual
1. The `onClick` with the router.back() call is missing.
2. Shallow routing does not seem to work.
### Extra Background
We have a nextjs package that exports some components. Some components use the `next/router`. We had no issues until recently. To fix these issues (NextRouter is not mounted, `useState` is not defined, etc) we switched to the `next/compat/router` for these components which seems to resolve the build/runtime errors, but it results in the above issues where the router does not seem to behave as expected.