Added missing prop to useActionState example#8308
Conversation
Size changesDetails📦 Next.js Bundle Analysis for react-devThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
|
Yeah that's intentional, this came up in review. Since there's no optimistic state for the count, having the total be pending is weird. Instead it's just a button that's pending until the API responds, and the other examples after this add more features and a better UX. But you can remove the isPending from Total for this example. |
@rickhanlonii gotcha, thanks for the explanation, have removed |
|
Thanks! |
In the first example of
useActionStatethe<Total />component deconstructs anisPendingprop, however it is not passed to it in the example. This means that theUpdating...text is never shown.https://react.dev/reference/react/useActionState#adding-state-to-an-action