Repository URL to install this package:
Version:
0.9.6 ▾
|
import React from 'react'
import { LinkProps } from './typings'
import { LinkElement } from './styled'
/**
* rendering a children, by default it renders the text
*/
function renderChildren(props: LinkProps) {
return props.children || props.text || 'Link'
}
/**
* rendering the Link
*/
function renderLink(props: LinkProps) {
const { className, target, urlBase, children, ...remainingProps } = props
return (
<LinkElement className={className} target={target} urlBase={urlBase} {...remainingProps}>
{children}
</LinkElement>
)
}
export { renderLink, renderChildren }