mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-29 05:00:06 +02:00

[web] Editor redesign: Make menu bar nestable GitOrigin-RevId: 5c08126499ff96494d6af9adcbd75126ddd596af
12 lines
381 B
TypeScript
12 lines
381 B
TypeScript
import { NestableDropdownContext } from '@/shared/context/nestable-dropdown-context'
|
|
import { useContext } from 'react'
|
|
|
|
export const useNestableDropdown = () => {
|
|
const context = useContext(NestableDropdownContext)
|
|
if (context === undefined) {
|
|
throw new Error(
|
|
'useNestableDropdown must be used within a NestableDropdownContextProvider'
|
|
)
|
|
}
|
|
return context
|
|
}
|