Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumReactReact Router v6Single-choice MCQ1 views

In React Router v6, you call `useSearchParams` and update a single param. You write the code below; users report that updating `page` wipes out the existing `status` filter. Why, and what's the fix?

const [searchParams, setSearchParams] = useSearchParams(); const goToPage = (n) => setSearchParams({ page: String(n) });