diff --git a/packages/app/src/app/pages/Search/index.js b/packages/app/src/app/pages/Search/index.js
index e0091410194..61a0c1af382 100644
--- a/packages/app/src/app/pages/Search/index.js
+++ b/packages/app/src/app/pages/Search/index.js
@@ -16,7 +16,7 @@ import {
} from 'react-instantsearch/dom';
import { Navigation } from 'app/pages/common/Navigation';
-import { inject, hooksObserver } from 'app/componentConnectors';
+import { useOvermind } from 'app/overmind';
import 'instantsearch.css/themes/reset.css';
@@ -32,89 +32,91 @@ const createURL = state => `?${qs.stringify(state)}`;
const searchStateToUrl = (location, searchState) =>
searchState ? `${location.pathname}${createURL(searchState)}` : '';
-const Search = inject('signals')(
- hooksObserver(({ history, location, signals: { searchMounted } }) => {
- const [searchState, setSearchState] = useState(
- qs.parse(location.search.slice(1))
- );
- const debouncedSetState = useRef(null);
-
- useEffect(() => {
- searchMounted();
- }, [searchMounted]);
-
- useEffect(() => {
- const unlisten = history.listen((loc, action) => {
- if (['POP', 'PUSH'].includes(action)) {
- setSearchState(qs.parse(loc.search.slice(1)));
- }
-
- return unlisten;
- });
- }, [history]);
-
- const onSearchStateChange = useCallback(
- newSearchState => {
- clearTimeout(debouncedSetState.current);
-
- debouncedSetState.current = setTimeout(() => {
- history.push(
- searchStateToUrl(location, newSearchState),
- newSearchState
- );
- }, updateAfter);
-
- setSearchState(newSearchState);
- },
- [history, location]
- );
-
- return (
-
-
- Search - CodeSandbox
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- })
-);
+const Search = ({ history, location }) => {
+ const {
+ actions: { searchMounted },
+ } = useOvermind();
+
+ const [searchState, setSearchState] = useState(
+ qs.parse(location.search.slice(1))
+ );
+ const debouncedSetState = useRef(null);
+
+ useEffect(() => {
+ searchMounted();
+ }, [searchMounted]);
+
+ useEffect(() => {
+ const unlisten = history.listen((loc, action) => {
+ if (['POP', 'PUSH'].includes(action)) {
+ setSearchState(qs.parse(loc.search.slice(1)));
+ }
+
+ return unlisten;
+ });
+ }, [history]);
+
+ const onSearchStateChange = useCallback(
+ newSearchState => {
+ clearTimeout(debouncedSetState.current);
+
+ debouncedSetState.current = setTimeout(() => {
+ history.push(
+ searchStateToUrl(location, newSearchState),
+ newSearchState
+ );
+ }, updateAfter);
+
+ setSearchState(newSearchState);
+ },
+ [history, location]
+ );
+
+ return (
+
+
+ Search - CodeSandbox
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
// eslint-disable-next-line import/no-default-export
export default Search;