rsnext/test/integration/client-navigation/pages/nav/pass-href-prop.js
Joe Haddad 18a9c7e371
Improve linting rules to catch more errors (#9374)
* Update `packages/`

* Update examples

* Update tests

* Update bench

* Update top level files

* Fix build

* trigger
2019-11-10 19:24:53 -08:00

27 lines
621 B
JavaScript

import Link from 'next/link'
const UnexpectedNestedA = () => {
const UnexpectedWrapper = props => {
const { href, id } = props
const safeProps = { href, id }
return <a {...safeProps}>{props.children}</a>
}
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>
)