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

Related issues

wagerfield picture wagerfield  ·  3Comments

DvirSh picture DvirSh  ·  3Comments

timneutkens picture timneutkens  ·  3Comments

olifante picture olifante  ·  3Comments

havefive picture havefive  ·  3Comments