React / Next.js Integration
Use FormSync with React and Next.js using the useFormSync hook.
Install the Package
Install FormSync using your preferred package manager:
Terminal
You can also use npm, yarn, or bun.
Please Note
FormSync is currently in development. We are actively working on improving the package. If you face any issues or have feedback, please create an issue on GitHub.
Basic Usage with React / Next.js
FormSync provides a clean React Hook API using the useFormSync hook.
This allows you to easily handle form submissions, loading states, and callbacks without manual state management.
Example
React Example
Handling Form States
Success Callback
The onSuccess callback is triggered when the form submission is successful.
tsx
Error Callback
The onError callback is triggered if the submission fails.
tsx
Both callbacks receive a structured response object from FormSync.
useFormSync Options
| Prop | Type | Required | Description |
|---|---|---|---|
formId | string | true | Your unique Form ID from the dashboard. |
onSuccess | function | false | Callback triggered on successful submission. |
onError | function | false | Callback triggered when submission fails. |
baseURL | string | false | Optional custom API base URL. |
Loading State
The useFormSync hook returns an isLoading boolean state. Use this to disable your submit button or show a loading spinner.
tsx
Spam Protection
FormSync automatically handles spam protection. There is no need to manually add honeypot fields to your form when using the useFormSync hook.
That’s It 🎉
Once your form is live:
- Submissions appear instantly in your FormSync dashboard
- No backend or API routes are needed
- Works seamlessly with React, Next.js, and static sites
You can now focus entirely on your UI while FormSync handles the rest.
How is this guide?
Last updated on March 21, 2026