Skip to content
This repository was archived by the owner on Feb 22, 2026. It is now read-only.

Fixing #145 routerv6 incompatible#146

Closed
NewJerseyStyle wants to merge 6 commits intoedge-civictechtofrom
fix/issue-145-react-routerv6
Closed

Fixing #145 routerv6 incompatible#146
NewJerseyStyle wants to merge 6 commits intoedge-civictechtofrom
fix/issue-145-react-routerv6

Conversation

@NewJerseyStyle
Copy link
Copy Markdown
Member

Using the useLocation hook to access the current location (i.e. location.pathname) instead of relying on this.props.history. Using the useNavigate hook to navigate to a new route replacing the history.push call.

Using the useLocation hook to access the current location (i.e. location.pathname) instead of relying on this.props.history.
Using the useNavigate hook to navigate to a new route replacing the history.push call.
@NewJerseyStyle NewJerseyStyle marked this pull request as draft March 20, 2025 12:50
1. The custom `withRouter` HOC is defined at the top. It uses Router v6 hooks (`useLocation`, `useNavigate`, and `useParams`) and injects them as a `router` prop.
2. The `Conversations` class component then accesses `location`, `navigate`, and `params` via `this.props.router`.
3. The class component is exported wrapped with the `withRouter` HOC.
@NewJerseyStyle NewJerseyStyle self-assigned this Mar 20, 2025
@NewJerseyStyle NewJerseyStyle added bug Something isn't working client-admin labels Mar 20, 2025
@NewJerseyStyle NewJerseyStyle linked an issue Mar 20, 2025 that may be closed by this pull request
@NewJerseyStyle
Copy link
Copy Markdown
Member Author

We don't update to router v6 then. We will let Polis be in router v5 and we will build better interface on civic tech prototype polis

@NewJerseyStyle NewJerseyStyle deleted the fix/issue-145-react-routerv6 branch April 9, 2025 14:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working client-admin

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

Screen went empty since login

1 participant