UNPKG

@atlaskit/page-layout

Version:

A collection of components which let you compose an application's page layout.

18 lines 583 B
import { useEffect } from 'react'; import { useSkipLinks } from './use-skip-links'; export var useSkipLink = function useSkipLink(id, skipLinkTitle) { var _useSkipLinks = useSkipLinks(), registerSkipLink = _useSkipLinks.registerSkipLink, unregisterSkipLink = _useSkipLinks.unregisterSkipLink; useEffect(function () { if (id && skipLinkTitle) { registerSkipLink({ id: id, skipLinkTitle: skipLinkTitle }); } return function () { unregisterSkipLink(id); }; }, [id, skipLinkTitle, registerSkipLink, unregisterSkipLink]); };