@atlaskit/page-layout
Version:
A collection of components which let you compose an application's page layout.
22 lines • 722 B
JavaScript
/**
* @jsxRuntime classic
* @jsx jsx
*/
import { useEffect } from 'react';
import { useSkipLinks } from '../../controllers';
export var useCustomSkipLink = function useCustomSkipLink(id, skipLinkTitle) {
var listIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
var _useSkipLinks = useSkipLinks(),
registerSkipLink = _useSkipLinks.registerSkipLink,
unregisterSkipLink = _useSkipLinks.unregisterSkipLink;
useEffect(function () {
registerSkipLink({
id: id,
skipLinkTitle: skipLinkTitle,
listIndex: listIndex
});
return function () {
unregisterSkipLink(id);
};
}, [id, listIndex, skipLinkTitle, registerSkipLink, unregisterSkipLink]);
};