forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make router UrlIsNew comparing method work as expected (vercel#6383)
* make router UrlIsNew comparing method work as expected * Remove shallow-equals from router and update urlIsNew check * Remove shallow-equals test since it is no longer used * Add integration test for asPath query
- Loading branch information
1 parent
42cff0a
commit 704edcc
Showing
5 changed files
with
39 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Link from 'next/link' | ||
import { withRouter } from 'next/router' | ||
|
||
export default withRouter(({ router: { asPath, query } }) => { | ||
return <div | ||
id={asPath | ||
.replace('/', '').replace('/', '-').replace('?', '-').replace('=', '-') | ||
}> | ||
<div id='router-query'>{JSON.stringify(query)}</div> | ||
<div> | ||
<Link href='/nav/as-path-query?something=hello' as='/something/hello?something=hello'> | ||
<a id='hello'>hello</a> | ||
</Link> | ||
</div> | ||
<div> | ||
<Link href='/nav/as-path-query?something=else' as='/something/hello?something=else'> | ||
<a id='hello2'>hello</a> | ||
</Link> | ||
</div> | ||
</div> | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.