import { createContext, useContext } from 'react' import { TimelineProps } from './Timeline' export type TimelineConfig = Required> export const timelineContext = createContext(null) export function useTimeline() { const context = useContext(timelineContext) if (context === null) { throw Error('TimelineItem should be used in Timeline.') } return context }