From 08209ec058aa8321ab5220d59f3f52a53077b72a Mon Sep 17 00:00:00 2001 From: Jorge Rojas Date: Sat, 28 Feb 2026 22:19:48 +0100 Subject: [PATCH] fix: fix the initial state of the current page --- 03-router-and-zustand/src/pages/Search.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/03-router-and-zustand/src/pages/Search.jsx b/03-router-and-zustand/src/pages/Search.jsx index ab541fd..81b791d 100644 --- a/03-router-and-zustand/src/pages/Search.jsx +++ b/03-router-and-zustand/src/pages/Search.jsx @@ -22,8 +22,8 @@ const useFilters = () => { const [textToFilter, setTextToFilter] = useState(() => searchParams.get('text') || '') const [currentPage, setCurrentPage] = useState(() => { - const page = Number(searchParams.get('page')) - return Number.isNaN(page) ? page : 1 + const page = parseInt(searchParams.get('page')) + return Number.isNaN(page) ? 1 : page }) const [jobs, setJobs] = useState([])