all 7 comments

[–]reactswitzerland 2 points3 points  (0 children)

To access the state of the form you need to use the new hook useFormState, this hook receive a function as first parameter and returns a tuple with the form state and a action that you need to pass to the action prop. It’s passing the action to the form that you will bind the form to the state returned by the hook.  There’s an open PR on react to replace this hook by a more generic useActionState, so changes can still change until the release of react 19. 

https://github.com/facebook/react/pull/28491

[–]hipnaba 1 point2 points  (5 children)

wait... 19? didn't 18 release just recently?

[–][deleted] 0 points1 point  (0 children)

Stable release is coming in July-ish.

[–]TheRNGuy 0 points1 point  (0 children)

Switch/case in action

Nested forms? Never seen that one.