A thin React client form component that automatically resets the form after submission.
bun add rsc-form
import {Form} from 'rsc-form'
function ServerComponent() {
async function handleSubmit(formData) {
"use server"
// do something
}
return (
<Form action={handleSubmit}>
<label>
Name:
<input type="text" name="name" />
</label>
<button type="submit">Submit</button>
</Form>
)
}
bun run build
bun test
- Typescript
- SWC
- Bun