Skip to content

Commit

Permalink
hds-1672: both SkipLinkProps are mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
Minna Salonen authored and Minna Salonen committed Jul 11, 2023
1 parent 07f4adc commit 9cf931a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ export type SkipLinkProps = {
/**
* ID of the element which is reached by clicking "skip link" shortcut
*/
skipTo?: string;
skipTo: string;
/**
* Label for skip link shortcut
*/
label?: string;
label: string;
};
export const SkipLink = ({ skipTo, label }: SkipLinkProps) => {
const href = skipTo?.startsWith('#') ? skipTo : `#${skipTo}`;
const href = skipTo.startsWith('#') ? skipTo : `#${skipTo}`;

return (
<a href={href} className={styles.skipLink}>
Expand Down

0 comments on commit 9cf931a

Please sign in to comment.