Files
react/scripts
Andrew Clark b4cdd3e892 Scaffolding for useFormState (#27270)
This exposes, but does not yet implement, a new experimental API called
useFormState. It's gated behind the enableAsyncActions flag.

useFormState has a similar signature to useReducer, except instead of a
reducer it accepts an (async) action function. React will wait until the
promise resolves before updating the state:

```js
async function action(prevState, payload) {
  // ..
}
const [state, dispatch] = useFormState(action, initialState)
```

When used in combination with Server Actions, it will also support
progressive enhancement — a form that is submitted before it has
hydrated will have its state transferred to the next page. However, like
the other action-related hooks, it works with fully client-driven
actions, too.
2023-08-23 10:58:09 -04:00
..
2023-01-31 08:25:05 -05:00
2023-01-31 08:25:05 -05:00
2023-08-22 10:41:04 -04:00
2023-08-22 10:12:28 -04:00
2023-01-31 08:25:05 -05:00
2023-01-31 08:25:05 -05:00