Next.js: <Link> should admit *any* element underneath

Created on 29 Jan 2017  路  3Comments  路  Source: vercel/next.js

What it shouldn't do is _create_ any element (for now we do, but we will show a warning)
The problem is that the current error message is misleading.

These should be possible:

<Link><img /></Link>
<Link><a /></Link>
<Link><a><img /></a></Link>

This should wrap with <a> for now and warn:

<Link>hi</Link>
<Link>{ ' woot' }</Link>

This should throw (dev-only, to ship less code)

<Link></Link>

https://github.com/zeit/next.js/blob/master/lib/link.js#L73

p0

Most helpful comment

Looking into this now 馃檶

All 3 comments

Looking into this now 馃檶

921

Thank you @timneutkens !

Was this page helpful?
0 / 5 - 0 ratings