Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Typo]: No mention of isPending in return values of useActionState #6808

Open
yossydev opened this issue Apr 28, 2024 · 0 comments
Open

[Typo]: No mention of isPending in return values of useActionState #6808

yossydev opened this issue Apr 28, 2024 · 0 comments

Comments

@yossydev
Copy link

yossydev commented Apr 28, 2024

Summary

I read the React19 blog. And I also read the documentation about useActionState.

I thought the difference between useActionState and useFormState was that the pending state is returned, but I don't see any mention of this in the current documentation.

Here is what the documentation says about Returns

#### Returns {/*returns*/}
`useActionState` returns an array with exactly two values:
1. The current state. During the first render, it will match the `initialState` you have passed. After the action is invoked, it will match the value returned by the action.
2. A new action that you can pass as the `action` prop to your `form` component or `formAction` prop to any `button` component within the form.

Perhaps you have renamed it from useFormState and left it in place? I think it would be better to add here that isPending is returned.

I have time to do this, so if it needs fixing I can do it. Please contact me anytime!

Page

https://react.dev/reference/react/useActionState

Details

There is a PR just like this one, but it seems to correct a different part of the problem than the one I am commenting on this time 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant