Verify canary release
Provide environment information
react: >= 18
next: >= 12.1.0
Which example does this report relate to?
all
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
not rendered Suspense fallback when change route
function Component () {
const { query: { page } } = useRouter();
const { data } = useQuery([page], () => api.get('...', { params: { page } }) );
return (
<p>{data}</p>
)
}
function App () {
return (
<Suspense fallback="loading...">
<Component />
</Suspense>
)
}
I think it's because of the startTransition of react
https://github.com/vercel/next.js/blob/canary/packages/next/src/client/index.tsx#L518-L522
Expected Behavior
render fallback component
can i perform this when provide startTransition option like priority of next/image?
ex)
function Component () {
const { query: { page } } = useRouter({ priority: false });
}
function Component () {
const router = useRouter();
return <button onClick={() => router.push('/', '/', { priority: false })} />
}
To Reproduce
codesandbox
Verify canary release
Provide environment information
Which example does this report relate to?
all
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
not rendered Suspense fallback when change route
I think it's because of the startTransition of react
https://github.com/vercel/next.js/blob/canary/packages/next/src/client/index.tsx#L518-L522
Expected Behavior
render fallback component
can i perform this when provide startTransition option like priority of
next/image?ex)
To Reproduce
codesandbox