Skip to content

hamlim/rsc-form

Repository files navigation

rsc-form

A thin React client form component that automatically resets the form after submission.

Installation:

bun add rsc-form

Usage:

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>
  )
}

Contributing:

build

bun run build

test

bun test

Tools:

  • Typescript
  • SWC
  • Bun

About

A simple React Server Component enhanced Form component

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published