-
Notifications
You must be signed in to change notification settings - Fork 26.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct page path for GS(S)P data refreshing (#16939)
This makes sure to the page path is the expected version to trigger refreshing on the client and adds additional tests to make sure it is working properly with these page variants. Closes: #16938
- Loading branch information
Showing
4 changed files
with
81 additions
and
1 deletion.
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
25 changes: 25 additions & 0 deletions
25
test/integration/gssp-ssr-change-reloading/pages/another/index.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,25 @@ | ||
import { useRouter } from 'next/router' | ||
|
||
export default function Gsp(props) { | ||
if (useRouter().isFallback) { | ||
return 'Loading...' | ||
} | ||
|
||
return ( | ||
<> | ||
<p id="change">change me</p> | ||
<p id="props">{JSON.stringify(props)}</p> | ||
</> | ||
) | ||
} | ||
|
||
export const getStaticProps = async () => { | ||
const count = 1 | ||
|
||
return { | ||
props: { | ||
count, | ||
random: Math.random(), | ||
}, | ||
} | ||
} |
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,25 @@ | ||
import { useRouter } from 'next/router' | ||
|
||
export default function Gsp(props) { | ||
if (useRouter().isFallback) { | ||
return 'Loading...' | ||
} | ||
|
||
return ( | ||
<> | ||
<p id="change">change me</p> | ||
<p id="props">{JSON.stringify(props)}</p> | ||
</> | ||
) | ||
} | ||
|
||
export const getStaticProps = async () => { | ||
const count = 1 | ||
|
||
return { | ||
props: { | ||
count, | ||
random: Math.random(), | ||
}, | ||
} | ||
} |
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