Next.js Discord

Discord Forum

server action pending state without useFormStatus

Answered
Baldfaced hornet posted this in #help-forum
Open in Discord
Baldfaced hornetOP
I found a solution with useTransition that seems to work at https://github.com/vercel/next.js/discussions/51371, however that hook docs say it should only wrap sync functions, so I wanted to ask if using it this way could cause any issues, or if there's other ways to do it.

action: https://github.com/Vsevolod-Shustov/holodex-nextjs/blob/main/app/lib/actions.ts
hook that use the action: https://github.com/Vsevolod-Shustov/holodex-nextjs/blob/main/app/hooks/useLiveData.ts
component that use the hook: https://github.com/Vsevolod-Shustov/holodex-nextjs/blob/main/app/components/VideoGrid.tsx
Answered by joulev
react added support for async transitions a few months ago
View full answer

3 Replies