UNPKG

react-hooks-global-scrollspy

Version:
15 lines (14 loc) 482 B
import { createContext } from "react"; /** * Context provides a way to pass DOM element activated and * Actions are used to control registered DOM elements * through the component tree without having to pass props down manually at every level. */ export var GlobalScrollSpyContext = createContext({ activeElement: null, actions: { registerElement: function (_) { }, unregisterElement: function (_) { }, resetElements: function () { }, }, });