packages/react/src/hooks/useLayout.ts (10 lines of code) (raw):
import { useContext } from 'react'
import { DesignerLayoutContext } from '../context'
import { IDesignerLayoutContext } from '../types'
import { globalThisPolyfill } from '@designable/shared'
export const useLayout = (): IDesignerLayoutContext => {
return (
globalThisPolyfill['__DESIGNABLE_LAYOUT__'] ||
useContext(DesignerLayoutContext)
)
}