-
Notifications
You must be signed in to change notification settings - Fork 27.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useOptimistic error #56997
Comments
If I good understand in the canary version of Next.js it uses the canary version of the React library. Recently React team removed a "experimental_" prefix from useOptimistic, useFormStatus, and useFormState. facebook/react#27459 So maybe upgrading Next.js to canary and removing 'experimental_' prefix will resolve your problem. |
Related #57026 |
I decided do it with react-query - TanStack/query#6179 |
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
npx --no-install next info Operating System: Platform: linux Arch: x64 Version: #1 SMP PREEMPT_DYNAMIC Debian 6.5.3-1kali2 (2023-10-03) Binaries: Node: 18.13.0 npm: 9.2.0 Yarn: 1.22.19 pnpm: 8.9.0 Relevant Packages: next: 13.5.6-canary.6 eslint-config-next: 13.5.3 react: 18.2.0 react-dom: 18.2.0 typescript: 5.2.2 Next.js Config: output: N/A
Which example does this report relate to?
https://nextjs.org/docs/app/building-your-application/data-fetching/forms-and-mutations
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
Expected 1 arguments, but got 2.ts(2554)
in this example
This line of code cause error - (state: Message[], newMessage: string) => [...state, { message: newMessage }],
Expected Behavior
I wait no error
I got error
To Reproduce
codesandbox - doesn't work
stackblitz - no way to open in vs code
github project - I don't want create repository only for this issue
1.pnpm create-next-app@latest
2.paste code above in page.tsx
3.got the error
The text was updated successfully, but these errors were encountered: