61c4cdb501
* Avoid adding basePath when it's not needed When using the `basePath` setting, on pages with params it will fire a router change. This will pass the url pathname in the `as` param using the `getUrl()` function. This means the `as` path will be sent through already including the `basePath`, leading to `/basePath/basePath/path` which will cause the router to throw an error. * lint * Add test case and ensure removal * Make sure to re-add before changeState Co-authored-by: JJ Kasper <jj@jjsweb.site>
3 lines
110 B
JavaScript
3 lines
110 B
JavaScript
import { useRouter } from 'next/router'
|
|
|
|
export default () => <p id="slug">slug: {useRouter().query.slug}</p>
|