2017-07-09 07:09:02 +02:00
|
|
|
import Link from 'next/link'
|
|
|
|
|
|
|
|
const UnexpectedNestedA = () => {
|
2019-05-30 03:19:32 +02:00
|
|
|
const UnexpectedWrapper = props => {
|
2019-02-19 22:45:07 +01:00
|
|
|
const { href, id } = props
|
|
|
|
const safeProps = { href, id }
|
2019-05-30 03:19:32 +02:00
|
|
|
return <a {...safeProps}>{props.children}</a>
|
2017-07-09 07:09:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return UnexpectedWrapper
|
|
|
|
}
|
|
|
|
|
|
|
|
const FakeA = UnexpectedNestedA()
|
|
|
|
|
|
|
|
export default () => (
|
|
|
|
<div className='nav-pass-href-prop'>
|
|
|
|
<Link href='/nav' passHref>
|
|
|
|
<FakeA id='with-href'>Will redirect as an `a` tag</FakeA>
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
<Link href='/nav'>
|
|
|
|
<FakeA id='without-href'>Will not redirect as an `a` tag</FakeA>
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
<p>This is the passHref prop page.</p>
|
|
|
|
</div>
|
|
|
|
)
|