From 952530f370a0d7c2d74a9c080bbe37e69745782a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 20 Nov 2022 00:05:45 +0300 Subject: Fix useSearchParams() usage --- vnext/src/ui/Feeds.js | 8 ++++---- vnext/src/ui/Post.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'vnext') diff --git a/vnext/src/ui/Feeds.js b/vnext/src/ui/Feeds.js index bd69155f..129be2de 100644 --- a/vnext/src/ui/Feeds.js +++ b/vnext/src/ui/Feeds.js @@ -45,7 +45,7 @@ function RequireAuth({ children }) { * */ export function Discover() { - const search = useSearchParams(); + const [search] = useSearchParams(); const query = { baseUrl: '/api/messages', search: search, @@ -84,7 +84,7 @@ export function Discussions() { */ export function Blog() { const { user } = useParams(); - const params = useSearchParams(); + const [params] = useSearchParams(); const search = { ...params, uname: user @@ -167,7 +167,7 @@ function Feed({ query }) { tag: '' }); const [loading, setLoading] = useState(true); - const filter = useSearchParams(); + const [filter] = useSearchParams(); useEffect(() => { setLoading(true); let getPageParam = (pageParam, lastMessage, /** @type { URLSearchParams } */ filterParams) => { @@ -202,7 +202,7 @@ function Feed({ query }) { }; }); }); - }, [location.search, query, filter]); + }, [query, filter]); return (state.msgs.length > 0 ? (