React Integration Guide
Complete guide to integrate MyFormConnect with React
Add working forms to any React app in under 10 minutes — no backend, server routes, or email services. Create a form in your MyFormConnect dashboard, copy the Form Action URL, and POST FormData with fetch.
Prerequisites
- A MyFormConnect account — sign up here (free)
- A form created in your MyFormConnect dashboard
-
Your unique Form Action URL (e.g.
https://myformconnect.io/f/YOUR_FORM_UUID) - Any existing React project (Vite, Next.js, Create React App, etc.)
Integration Methods
Contact form
A full contact form with inline success/error states. Submissions go to MyFormConnect with spam and honeypot protection handled for you.
Create your form and copy the Form Action URL
http://localhost:5173 or http://localhost:3000 for local work), create a form, then copy the Form Action URL.
- Open Domains → add or select a domain
- Set Domain URL to your React origin (local or production)
- Add a new form and copy
https://myformconnect.io/f/YOUR_FORM_UUID
Important Note
Create a React form component
src/components/ContactForm.jsx (or similar). Replace YOUR_FORM_UUID with your real UUID.
import React, { useState } from 'react';
// Paste your MyFormConnect Form Action URL here:
const CONTACT_FORM_ACTION_URL = 'https://myformconnect.io/f/YOUR_FORM_UUID';
export default function ContactForm() {
const [status, setStatus] = useState('idle'); // 'idle' | 'submitting' | 'success' | 'error'
const [errorMessage, setErrorMessage] = useState('');
const handleSubmit = async (e) => {
e.preventDefault();
const form = e.currentTarget;
setStatus('submitting');
setErrorMessage('');
try {
const response = await fetch(CONTACT_FORM_ACTION_URL, {
method: 'POST',
headers: {
Accept: 'application/json',
'X-Requested-With': 'XMLHttpRequest',
},
body: new FormData(form),
});
if (!response.ok) {
throw new Error('Submission failed');
}
setStatus('success');
form.reset();
} catch (err) {
setStatus('error');
setErrorMessage('Unable to submit your message. Please try again.');
}
};
const inputStyle = {
width: '100%',
boxSizing: 'border-box',
padding: '10px 12px',
borderRadius: '6px',
border: '1px solid #cbd5e1',
fontSize: '14px',
fontFamily: 'inherit',
};
if (status === 'success') {
return (
<div style={{ textAlign: 'center', padding: '24px', background: '#f0fdf4', borderRadius: '8px', color: '#166534' }}>
<h3 style={{ margin: '0 0 8px 0' }}>Thank You!</h3>
<p style={{ margin: 0 }}>Your message has been sent successfully. We will get back to you soon.</p>
<button
type="button"
onClick={() => setStatus('idle')}
style={{ marginTop: '16px', padding: '8px 16px', cursor: 'pointer', borderRadius: '6px', border: '1px solid #bbf7d0', background: '#ffffff' }}
>
Send Another Message
</button>
</div>
);
}
return (
<form onSubmit={handleSubmit} style={{ display: 'flex', flexDirection: 'column', gap: '14px', maxWidth: '480px', width: '100%', boxSizing: 'border-box' }}>
{status === 'error' && (
<div style={{ color: '#b91c1c', background: '#fef2f2', padding: '10px 12px', borderRadius: '6px', fontSize: '13px' }}>
{errorMessage}
</div>
)}
<div>
<label htmlFor="name" style={{ display: 'block', fontWeight: 600, fontSize: '13px', marginBottom: '6px' }}>
Full Name *
</label>
<input id="name" name="name" type="text" placeholder="Jane Doe" required style={inputStyle} />
</div>
<div>
<label htmlFor="email" style={{ display: 'block', fontWeight: 600, fontSize: '13px', marginBottom: '6px' }}>
Email Address *
</label>
<input id="email" name="email" type="email" placeholder="[email protected]" required style={inputStyle} />
</div>
<div>
<label htmlFor="message" style={{ display: 'block', fontWeight: 600, fontSize: '13px', marginBottom: '6px' }}>
Message *
</label>
<textarea id="message" name="message" rows={4} placeholder="How can we help you?" required style={{ ...inputStyle, resize: 'vertical' }} />
</div>
<button
type="submit"
disabled={status === 'submitting'}
style={{
padding: '12px',
background: '#2D5DEA',
color: '#ffffff',
fontWeight: 600,
fontSize: '14px',
border: 'none',
borderRadius: '6px',
cursor: status === 'submitting' ? 'not-allowed' : 'pointer',
opacity: status === 'submitting' ? 0.7 : 1,
}}
>
{status === 'submitting' ? 'Sending…' : 'Send Message'}
</button>
<p style={{ fontSize: '11px', color: '#64748b', textAlign: 'center', margin: '4px 0 0 0' }}>
Powered by{' '}
<a href="https://myformconnect.io" target="_blank" rel="noopener noreferrer" style={{ color: '#2D5DEA', fontWeight: 600, textDecoration: 'none' }}>
MyFormConnect
</a>
</p>
</form>
);
}
Important Note
name. Do not set Content-Type. Do not JSON.stringify — pass new FormData(form) as the body.
Run and verify
- Import
ContactFormintoApp.jsxor a contact page - Run
npm run dev(or your usual start command) - Submit the form and confirm the lead in the dashboard
import ContactForm from './components/ContactForm';
export default function App() {
return (
<div style={{ padding: '40px' }}>
<h1>Contact Us</h1>
<ContactForm />
</div>
);
}
Related Integrations
References & Official Documentation
Next Steps
Configure MyFormConnect
- Set up your timezone
- Configure lead notifications
- Set up advanced spam detection
- Add team members to your account
Advanced Features
- Use our custom form templates
- Try AI Insights for Leads
- Integrate with your CRM
- Set up automated workflows