fix: Scroll does not reset when navigating shared docs on mobile (#7037)

closes #6968
This commit is contained in:
Tom Moor
2024-06-14 19:36:36 -04:00
committed by GitHub
parent f35676f347
commit f8a9c18650
5 changed files with 61 additions and 32 deletions

View File

@@ -0,0 +1,15 @@
import * as React from "react";
/**
* Context to provide a reference to the scrollable container
*/
const ScrollContext = React.createContext<
React.RefObject<HTMLDivElement> | undefined
>(undefined);
/**
* Hook to get the scrollable container reference
*/
export const useScrollContext = () => React.useContext(ScrollContext);
export default ScrollContext;