Skip to main content

Strapi users react-router-dom v6

Strapi 5 uses react-router-dom v6. This impacts the links added to settings or to the menu using the Admin Panel API.

This page is part of the breaking changes database and provides information about the breaking change and additional instructions to migrate from Strapi v4 to Strapi 5.

🔌 Is this breaking change affecting plugins?Yes
🤖 Is this breaking change automatically handled by a codemod?Yes

Breaking change description

In Strapi v4

  • Strapi v4 uses react-router-dom v5.
  • When adding settings or menu links, the to property is an absolute path.

In Strapi 5

  • Strapi v5 uses react-router-dom v6.
  • When adding settings or menu links, the to property should now be a relative path.

Migration

This section regroups useful notes and procedures about the introduced breaking change.

Notes

  • The official React Router documentation explains how to upgrade from v5.
  • Absolute paths for menu or settings links are still supported but should yield a warning.

Manual procedure

This breaking change should be handled by a codemod (see the full list of 5.0.0 codemods). Ensure that links added to settings or to the menu links using the Admin Panel API use relative paths.