Next.js: next/link silently ignores params in case of typo

Created on 25 Feb 2017  路  5Comments  路  Source: vercel/next.js

If I use <Link href='/' prefetc> (notice the typo), there's no error message. Possibly similar comment for other params and other Next.js APIs.

feature request

All 5 comments

Actually, it's good dev only feature. We expose few APIs like this, so we might need to have them for those as well.

Anyway, I'd like to see this as a linter something externally. Anyway, this is something I'd love to see.

Flow would catch this. I noticed the prefetch tag is missing though.
https://github.com/zeit/next.js/blob/master/examples/with-flow

Seems like the best option is https://github.com/airbnb/prop-types forbidExtraProps since this wouldn't require someone to setup flow types etc. @arunoda If you agree I will implement this 馃憤
We could just copy over https://github.com/airbnb/prop-types/blob/master/src/forbidExtraProps.js to not hog in the whole library.

Seems like ljharb released it as separate package: https://github.com/airbnb/prop-types-exact pretty cool 馃憣 I'll experiment with it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

olifante picture olifante  路  3Comments

swrdfish picture swrdfish  路  3Comments

sospedra picture sospedra  路  3Comments

pie6k picture pie6k  路  3Comments

timneutkens picture timneutkens  路  3Comments