Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

React + Vite

A React contact form component that submits to FormHandle via fetch().

Setup

npm create vite@latest my-app -- --template react
cd my-app
npm install
npx formhandle init

Copy ContactForm.jsx into your src/ directory and import it.

Usage

import ContactForm from './ContactForm'

function App() {
  return (
    <div>
      <h1>My Site</h1>
      <ContactForm handlerId="YOUR_HANDLER_ID" />
    </div>
  )
}

Replace YOUR_HANDLER_ID with your actual handler ID, or read it from an environment variable:

<ContactForm handlerId={import.meta.env.VITE_FORMHANDLE_ID} />
# .env
VITE_FORMHANDLE_ID=abc123