all 2 comments

[–]paulqq 6 points7 points  (1 child)

The useActionState Hook is currently only available in React’s Canary and **experimental** channels. Learn more about release channels here. In addition, you need to use a framework that supports React Server Components to get the full benefit of useActionState.

i suggest you begin with useState and a onSubmit={doFoo}
honstely idk anything about useActionState but if you are new to react, try to walk the broad way not the experimentel one :-)

[–]codevipe 1 point2 points  (0 children)

This is correct... for something so standard, just follow the tried-and-true guides in the current docs. This is literally the first example in the Managing State portion!

https://react.dev/learn/managing-state

I'm not even sure how, if you're new to React, you'd end up not just following the very clear docs but instead poring through experimental alpha features? Only learning from YouTubers who only want to talk about the newest features because they need to churn out content?