From edfd0194ed999d4775a1ac51f8e3d539a040f46b Mon Sep 17 00:00:00 2001 From: Dao Tuan Date: Mon, 8 Mar 2021 22:29:33 +0700 Subject: [PATCH] fix: set searching state when calling pagination --- .changeset/chatty-pears-serve.md | 5 +++++ packages/hooks/src/ContextProvider/index.tsx | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/chatty-pears-serve.md diff --git a/.changeset/chatty-pears-serve.md b/.changeset/chatty-pears-serve.md new file mode 100644 index 000000000..6903e909d --- /dev/null +++ b/.changeset/chatty-pears-serve.md @@ -0,0 +1,5 @@ +--- +'@sajari/react-hooks': patch +--- + +Set searching state when calling pagination request diff --git a/packages/hooks/src/ContextProvider/index.tsx b/packages/hooks/src/ContextProvider/index.tsx index 492e1fbf4..fc1a07544 100644 --- a/packages/hooks/src/ContextProvider/index.tsx +++ b/packages/hooks/src/ContextProvider/index.tsx @@ -296,6 +296,7 @@ const ContextProvider: React.FC = ({ const { config } = searchState; variables.set({ [config.pageParam]: String(page) }); + setSearching(true); pipeline.search(variables.get()); }, [search.pipeline, search.variables, searchState.config],