Upgrade from React 17 to 18

Proprietary

Move a React 17 codebase to React 18: replace ReactDOM.render with createRoot, remove unstable_batchedUpdates wrappers, replace unmountComponentAtNode, remove render callbacks, and declare children on props types for @types/react 18. Unlike upgrade-to-react-18, this does not re-run the migrations of earlier majors, so it moves a project that is already on React 17 exactly one major version.

org.openrewrite.react.migrate.react-17-to-18
mod run . --recipe=org.openrewrite.react.migrate.react-17-to-18

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.