React Router 7
3.14 upgrades react-router and react-router-dom from 6.30.3 to 7.18.7.
React Router 6 reached end of life when React Router 8 was released, and security fixes no longer reach it. The fix for GHSA-x8j4-g9rr-8j87, a slow regular expression in route matching, shipped only in 7.18.3 and 8.3.1.
If you deploy the shipped OHIF viewer as-is, this change is invisible. The viewer
already ran with the two React Router 6 future flags that affect it
(v7_startTransition and v7_relativeSplatPath), so navigation behaves as before.
Runtime plugins
react-router and react-router-dom are
shared host packages:
a runtime plugin does not bundle them, and uses the viewer's copy at runtime. The
viewer now provides version 7.
A plugin that is already built keeps working if it uses only the hooks and
components, such as useNavigate, useLocation, useParams, Link, Routes and
Route. Version 7 exports them under the same names from both packages.
A plugin must be changed if it uses an API that version 7 removes:
| Removed in React Router 7 | Use instead |
|---|---|
json(data) | return the object itself |
defer(data) | return the object itself; promises in it are streamed |
AbortedDeferredError | none — defer is gone |
the future prop on <BrowserRouter> and the v7_* flags | remove it; version 7 behaves as the flags did |
What to do: set the peer ranges of both packages to ^7.0.0.
create-ohif migrate makes this change. See React Router's
upgrade guide from version 6 for the full list.
Extensions and modes compiled into the viewer
An extension or mode that you add under extensions/ or modes/ gets React Router
7 from the viewer. If its package.json names react-router or react-router-dom,
change the version to 7.18.7.