fix(search): use parent if its state is defined

Co-authored-by: Anders Näsman <andersn@spotify.com>
Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
Camila Belo
2022-05-17 09:53:32 +02:00
parent c1f303cc90
commit 87f17276f5
@@ -136,7 +136,7 @@ export function useSearchModal(initialState = false) {
);
// Inherit from parent context, if set.
return parentContextValue
return parentContextValue?.state
? parentContextValue
: { state, toggleModal, setOpen };
}