mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Discover] Fix issue where Discover breadcrumb link breaks in surrounding documents after filters have been added or modified
This commit is contained in:
parent
948fb53e4a
commit
f577e463d4
1 changed files with 8 additions and 1 deletions
|
@ -66,7 +66,14 @@ const getCurrentBreadcrumbs = (
|
|||
|
||||
export const useMainRouteBreadcrumb = () => {
|
||||
// useRef needed to retrieve initial breadcrumb link from the push state without updates
|
||||
return useRef(useHistory<HistoryState>().location.state?.breadcrumb).current;
|
||||
const breadcrumb = useRef<string>();
|
||||
const history = useHistory<HistoryState>();
|
||||
|
||||
if (history.location.state?.breadcrumb) {
|
||||
breadcrumb.current = history.location.state.breadcrumb;
|
||||
}
|
||||
|
||||
return breadcrumb.current;
|
||||
};
|
||||
|
||||
export const useNavigationProps = ({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue