import { useContext } from 'react'; import { DescendantContextType } from './DescendantsContext'; /** * Returns the Descendants data structure from the provided context object */ export const useDescendantsContext = ( context: DescendantContextType, ) => { const { descendants } = useContext(context); return { descendants }; };