UNPKG

@atlaskit/navigation-system

Version:

The latest navigation system for Atlassian apps.

20 lines (19 loc) • 616 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useLayoutId = useLayoutId; var _useSkipLinkId = require("./use-skip-link-id"); /** * Returns an ID for use by the layout element and skip links. * * If the consumer has already provided an ID, it will be used instead. * Otherwise, a unique ID will be returned. */ function useLayoutId() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, providedId = _ref.providedId; var uniqueId = (0, _useSkipLinkId.useSkipLinkId)(); var id = providedId ? providedId : uniqueId; return id; }