Repository URL to install this package:
|
Version:
4.0.75 ▾
|
import React from 'react'
import { SkipNavAnchorLink } from './styled'
import { SkipNavProps } from './typings'
/**
* @todo @see README.md
*/
const Portal = (props: SkipNavProps) => props.children
class SkipNav extends React.PureComponent<SkipNavProps> {
static defaultProps = {
to: 'main',
identifier: 'skipnav',
}
render() {
const identifier = this.props.identifier
const to = '#' + this.props.to
// tabIndex={}
return (
<Portal id={identifier}>
<SkipNavAnchorLink href={to}>Skip to main content</SkipNavAnchorLink>
</Portal>
)
}
}
export { SkipNav }
export default SkipNav