fix: Scroll does not reset when navigating shared docs on mobile (#7037)
closes #6968
This commit is contained in:
15
app/components/ScrollContext.ts
Normal file
15
app/components/ScrollContext.ts
Normal 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;
|
||||
Reference in New Issue
Block a user