getPageContextClient()
Get pageContext of the currently rendered page on the client-side.
It's usually used for getting the pageContext of a newly navigated page:
import { getPageContextClient, navigate } from 'vike/client/router'
function SignupForm() {
return <form onSubmit={onSubmit}>{/* ... */}</form>
}
async function onSubmit() {
await navigate('/welcome')
// Get the `pageContext` object of the newly navigated /welcome page
const pageContext = getPageContextClient()
// ...
}