The example code under the Usage section does not compile in the preview canvas because the react and react-dom packages do not match. To ensure they are not out of sync, they can be pinned to the same version in the package.json file instead of pulled using the "canary" tag.
Summary
The example code under the Usage section does not compile in the preview canvas because the react and react-dom packages do not match. To ensure they are not out of sync, they can be pinned to the same version in the package.json file instead of pulled using the "canary" tag.
Page
https://react.dev/reference/react/useActionState#usage
Details
Error Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got: