({action})
| 2225 | } |
| 2226 | |
| 2227 | function Form({action}) { |
| 2228 | const [, startFormTransition] = useTransition(); |
| 2229 | |
| 2230 | function onSubmit(event) { |
| 2231 | event.preventDefault(); |
| 2232 | // Schedule an empty action for no other purpose than to trigger the |
| 2233 | // pending state. |
| 2234 | startFormTransition(async () => {}); |
| 2235 | } |
| 2236 | return ( |
| 2237 | <form ref={formRef} action={action} onSubmit={onSubmit}> |
| 2238 | <Status /> |
| 2239 | </form> |
| 2240 | ); |
| 2241 | } |
| 2242 | |
| 2243 | const formRef = React.createRef(); |
| 2244 | const root = ReactDOMClient.createRoot(container); |
nothing calls this directly
no test coverage detected