UNPKG

@atlaskit/navigation-system

Version:

The latest navigation system for Atlassian apps.

20 lines (19 loc) • 870 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useTopNavBreakpoints = useTopNavBreakpoints; var _react = require("react"); var _topNavElementContext = require("./top-nav-element-context"); /** * Private breakpoint state for React rendering (overflow and responsive buttons). * Presentation is handled by TopNav container queries, independently of this hook. * Returns null outside TopNav or when platform-dst-chat-panel-layout is disabled. * SSR and initial hydration have no measured width. Each consumer chooses its * fallback until measurement is published in a transition, allowing suspended * navigation to finish hydrating without losing its server DOM. All consumers * share one observer on TopNav. */ function useTopNavBreakpoints() { return (0, _react.useContext)(_topNavElementContext.TopNavElementContext); }