Skip to content

Commit

Permalink
Fixed React transition loading for synchronous server actions
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianLeChat committed Dec 14, 2024
1 parent fe95450 commit 850733b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion utilities/recaptcha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ export default async function serverAction(
// On exécute alors l'action côté serveur sans vérification.
try
{
return action( formData );
let response;

startTransition( () =>
{
response = action( formData );
} );

return response;
}
catch
{
Expand Down

0 comments on commit 850733b

Please sign in to comment.