Performance: Form component and method
MEDIUM IMPACT
This affects page load speed and interaction responsiveness by controlling how form submissions are handled and how much JavaScript is needed.
import { Form } from '@remix-run/react'; export default function GoodForm() { return ( <Form method="post"> <input name="email" type="email" required aria-label="Email address" /> <button type="submit">Send</button> </Form> ); }
import React from 'react'; export default function BadForm() { return ( <form action="/submit" method="post"> <input name="email" type="email" required /> <button type="submit">Send</button> </form> ); }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Plain HTML form with full reload | Minimal DOM nodes | Triggers 1 full reflow and repaint on submit | High paint cost due to full reload | [X] Bad |
| Remix Form component with method | Minimal DOM nodes | No reflow from submit, only targeted updates | Low paint cost, no full reload | [OK] Good |