From 18c7843271fdfcbdefede015bfd65decbf76e765 Mon Sep 17 00:00:00 2001 From: TuanD Date: Tue, 9 Mar 2021 07:59:58 +0700 Subject: [PATCH] fix: set searching state when calling pagination (#433) Co-authored-by: Sam Potts --- .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],