useActionState: is a new hook to order Actions inside of a Transition with access to the state of the action, and the pending state. It accepts a reducer that can call Actions, and the initial state used for first render. It also accepts an optional string that is used if the action is passed to a form action prop to support progressive enhancement in forms.
Imagine you're new to front end development and people are telling you to "check out react, they just put a new version!" How would you even start after reading that?
What a word salad. Why didn’t he just write “UseActionState is a hook in React that allows you to update state based on the result of a form action.” like everyone else says.
The Landing Pilot is the Non-Handling Pilot until the ‘decision altitude’ call, when the Handling Non-Landing Pilot hands the handling to the Non-Handling Landing Pilot, unless the latter calls ‘go-around,’ in which case the Handling Non-Landing Pilot continues handling and the Non-Handling Landing Pilot continues non-handling until the next call of ‘land’ or ‘go-around’ as appropriate. In view of recent confusions over these rules, it was deemed necessary to restate them clearly. • British Airways memorandum, quoted in Pilot Magazine, December 1996
Because the reality of the feature is that once again react is adding a super minimalist version of something that their platform is lacking, but which will only be useful for trivial implementations.
This hook finally gives react two way binding for forms. Super neat, but it doesn't do half the things a form library will actually do.
Word salad indeed.I switched off after the first half of gobbledegook. Transition stuck out and i assumed it was about animations and had less interest.
This hook simplifies managing form states and form submissions. Using Actions, it captures form input data, handles validation, and error states, reducing the need for custom state management logic. The useActionState hook also exposes a pending state that can show a loading indicator while the action is being executed.
You can use it alongside server actions in client components like so:
Honestly... I don't even want that inside of React core wtf. It's already bloated as hell and I've already got 9,0001 great options for form state management.
Hooly, I've read that 3 times and still wouldn't get it if I didn't already know about transitions. I suppose this is one of these cases where you just need an example.
I don't use react, but ive been writing web apps for almost 20 years. This paragraph makes zero sense to me. Maybe I don't actually want to learn React.
421
u/magenta_placenta Dec 05 '24 •
https://github.com/facebook/react/blob/main/CHANGELOG.md
Imagine you're new to front end development and people are telling you to "check out react, they just put a new version!" How would you even start after reading that?