MCPcopy
hub / github.com/facebook/react / Form

Function Form

packages/react-dom/src/__tests__/ReactDOMForm-test.js:2227–2241  ·  view source on GitHub ↗
({action})

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

useTransitionFunction · 0.50

Tested by

no test coverage detected