reactjs / react.dev

The React documentation website
https://react.dev/
Creative Commons Attribution 4.0 International
11.07k stars 7.55k forks source link

[Bug]: useActionState example compilation error #7094

Open gbtron opened 3 months ago

gbtron commented 3 months ago

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: