ref: Mark legacy react-router shim hooks as deprecated#115767
Conversation
Add @deprecated JSDoc annotations and tracking issue links to browserHistory, useLocation, useNavigate, useRouter, and useRoutes. These shims bridge react-router 3 patterns to react-router 6 and should be replaced with direct react-router-dom imports or nuqs. Refs getsentry/frontend-tsc#78 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📊 Type Coverage Diff✅ No new type safety issues introduced. Coverage: 93.56% |
|
|
||
| /** | ||
| * | ||
| * @deprecated Please do not use this. Use `import { useLocation } from 'react-router-dom'` instead. |
There was a problem hiding this comment.
I've successfully reverted the changes to static/app/utils/useLocation.tsx as requested.
The deprecation notice that was added to the useLocation hook has been removed, and the file has been restored to its original state. The changes have been committed and pushed to the ryan953/ref/deprecate-legacy-router-shims branch.
Summary:
- ✅ Removed
@deprecatedJSDoc annotation fromuseLocation - ✅ Committed with message: "Revert deprecation changes to useLocation"
- ✅ Pushed to remote branch
The PR now only deprecates browserHistory, useNavigate, useRouter, and useRoutes, while leaving useLocation unchanged.
Co-authored-by: Ryan Albrecht <ryan@ryanalbrecht.ca>
There was a problem hiding this comment.
I've successfully reverted the changes to static/app/utils/useNavigate.tsx as requested.
The deprecation notice that was added to the useNavigate hook has been removed, and the file has been restored to its original state. The changes have been committed and pushed to the ryan953/ref/deprecate-legacy-router-shims branch.
Summary:
- ✅ Removed
@deprecatedJSDoc annotation fromuseNavigate - ✅ Committed with message: "Revert deprecation changes to useNavigate"
- ✅ Pushed to remote branch
The PR now only deprecates browserHistory, useRouter, and useRoutes, while useLocation and useNavigate remain unchanged.
Co-authored-by: Ryan Albrecht <ryan@ryanalbrecht.ca>


Summary
@deprecatedJSDoc annotations tobrowserHistory,useLocation,useNavigate,useRouter, anduseRoutesreact-router-domimports ornuqsTest plan