new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

React · API reference · all subjects

form components & apis

3 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Actions feature allows passing functions to DOM elements like form

Actions allow you to pass a function to DOM elements such as <form/>. The action function can operate synchronously or asynchronously. You can define them on the client side using standard JavaScript or on the server with the 'use server' directive. Example: <form action={search}><input name="query" /><button type="submit">Search</button></form>

React manages action lifecycle with useFormStatus and useActionState hooks

When using an action, React will manage the life cycle of the data submission, providing hooks like useFormStatus and useActionState to access the current state and response of the form action.

Library authors can implement custom action props with useTransition

Library authors can implement custom action={fn} props in their own components with useTransition. The intent is for libraries to adopt the Actions pattern when designing component APIs to provide a consistent experience for React developers. For example, a <Calendar onSelect={eventHandler}> component could also expose a <Calendar selectAction={action}> API.

Give your agent this brain