Commit 7b25e299 authored by Luis Fernando Alvarez D's avatar Luis Fernando Alvarez D Committed by Joe Haddad

Export types for link props (#7905)

* export LinkProps

* Add test
parent 8078273a
......@@ -45,9 +45,9 @@ function formatUrl(url: Url) {
return url && typeof url === 'object' ? formatWithValidation(url) : url
}
type LinkProps = {
export type LinkProps = {
href: Url
as?: Url | undefined
as?: Url
replace?: boolean
scroll?: boolean
shallow?: boolean
......
import React from 'react'
import Link, { LinkProps } from 'next/link'
export default () => {
const props: LinkProps = {
href: '/page',
as: '/as-page',
onError() {},
}
return (
<Link {...props}>
<a>Test</a>
</Link>
)
}
......@@ -3,6 +3,7 @@ import { useRouter } from 'next/router'
import { hello } from '../components/hello'
import { World } from '../components/world'
import Router from '../components/router'
import Link from '../components/link'
export default function HelloPage(): JSX.Element {
const router = useRouter()
......@@ -12,6 +13,7 @@ export default function HelloPage(): JSX.Element {
<div>
{hello()} <World />
<Router />
<Link />
</div>
)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment