-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure query for static pages with rewrites is updated correctly (#24189
) This updates the query refreshing on the client to also refresh when rewrites are used and the page is static since additional query values can be provided from rewrites that are relied on client-side. An additional test has been added in the custom-routes suite to ensure this is working correctly. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added Fixes: #23490 Fixes: #22931 Fixes: #21062
- Loading branch information
Showing
8 changed files
with
73 additions
and
9 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 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 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 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 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 |
---|---|---|
@@ -1,5 +1,11 @@ | ||
import { useRouter } from 'next/router' | ||
|
||
export default function Page() { | ||
return <p id="auto-export">auto-export {useRouter().query.slug}</p> | ||
const router = useRouter() | ||
return ( | ||
<> | ||
<p id="auto-export">auto-export {router.query.slug}</p> | ||
<p id="query">{JSON.stringify(router.query)}</p> | ||
</> | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
test/integration/custom-routes/pages/auto-export/another.js
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,11 @@ | ||
import { useRouter } from 'next/router' | ||
|
||
export default function Page() { | ||
const router = useRouter() | ||
return ( | ||
<> | ||
<p id="auto-export-another">auto-export another</p> | ||
<p id="query">{JSON.stringify(router.query)}</p> | ||
</> | ||
) | ||
} |
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 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