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:
@@ -136,7 +136,7 @@ export function useSearchModal(initialState = false) {
|
||||
);
|
||||
|
||||
// Inherit from parent context, if set.
|
||||
return parentContextValue
|
||||
return parentContextValue?.state
|
||||
? parentContextValue
|
||||
: { state, toggleModal, setOpen };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user