Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[front] - feat(hooks): implement custom hook for managing query params #11236

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JulesBelveze
Copy link
Contributor

@JulesBelveze JulesBelveze commented Mar 5, 2025

Description

This PR implements a custom React hook useQueryParams to manage URL query parameters in a type-safe and efficient way.
The hook provides individual getters and setters for each parameter along with a batch update function. It handles URL updates with shallow routing and prevents unnecessary state updates and router pushes.

Note: this is a useHashParams on steroid.

Risk

None

Deploy Plan

Deploy front

 - Add a hook (`useQueryParams`) that provides getter and setter functions for specified query parameters
 - Ensure the state updates only when query parameter values actually change to avoid unnecessary re-renders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant