import { createContext, RefObject, useContext } from 'react'; import { usePageScrollContext } from '@wix/design-system'; interface ScrollableContentContextValue { scrollableContentRef: RefObject; } export const ScrollableContentContext = createContext(null); export function useScrollableContentContext() { const value = useContext(ScrollableContentContext); const pageScrollContext = usePageScrollContext(); if (value != null) { return value; } return pageScrollContext; }