UNPKG

@navikt/ds-react

Version:

React components from the Norwegian Labour and Welfare Administration.

20 lines 619 B
import { createContext, useContext } from "react"; export const TimelineContext = createContext({ startDate: new Date(), endDate: new Date(), direction: "left", setStart: () => null, setEndInclusive: () => null, activeRow: 0, setActiveRow: () => null, initiate: () => null, addFocusable: () => null, }); export const useTimelineContext = () => { const context = useContext(TimelineContext); if (!context) { console.warn("useTimelineContext must be used with TimelineContext (<Timeline />)"); } return context; }; //# sourceMappingURL=useTimelineContext.js.map