rsnext/packages
Damien Varron 55afe80c31
Only prefetch Link if router is in context (#19857)
Fixes #16864 

The `router` can be missing in a test environment when trying to render a `Link` component. This PR bails out of `router.prefetch()` when `router` is missing.

The alternative is for users to mock `next/link` or to mock the `router` and wrap their test components.

Please let me know any feedback.
2021-01-06 16:19:57 +00:00
..
create-next-app v10.0.5-canary.10 2021-01-05 20:20:36 -05:00
eslint-plugin-next v10.0.5-canary.10 2021-01-05 20:20:36 -05:00
next Only prefetch Link if router is in context (#19857) 2021-01-06 16:19:57 +00:00
next-bundle-analyzer v10.0.5-canary.10 2021-01-05 20:20:36 -05:00
next-codemod v10.0.5-canary.10 2021-01-05 20:20:36 -05:00
next-env v10.0.5-canary.10 2021-01-05 20:20:36 -05:00
next-mdx v10.0.5-canary.10 2021-01-05 20:20:36 -05:00
next-plugin-google-analytics v10.0.5-canary.10 2021-01-05 20:20:36 -05:00
next-plugin-sentry v10.0.5-canary.10 2021-01-05 20:20:36 -05:00
next-plugin-storybook v10.0.5-canary.10 2021-01-05 20:20:36 -05:00
next-polyfill-module v10.0.5-canary.10 2021-01-05 20:20:36 -05:00
next-polyfill-nomodule v10.0.5-canary.10 2021-01-05 20:20:36 -05:00
react-dev-overlay v10.0.5-canary.10 2021-01-05 20:20:36 -05:00
react-refresh-utils v10.0.5-canary.10 2021-01-05 20:20:36 -05:00