Upgrade from React 16 to 17

Proprietary

Move a React 16 codebase to React 17: move deprecated lifecycle methods where that is safe, prefix the rest with UNSAFE_, remove unnecessary import React, remove event.persist() calls, and switch explicitly configured tsconfig/jsconfig, Babel and ESLint JSON settings to the new JSX transform (projects that set jsxFactory, or Babel pragma, are left alone). Unlike upgrade-to-react-17, this does not re-run the migrations of earlier majors, so it moves a project that is already on React 16 exactly one major version.

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

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