next-data-link
v1.0.21
Published
Call getInitialProps with Next.js's <Link> while prefetching
Downloads
29
Maintainers
Readme
next-data-link
Call getInitialProps with Next.js's <Link> while prefetching
Install
yarn add next-data-link
npm i next-data-link --save
Usage
import DataLink from 'next-data-link';
<DataLink href={...}>
<a>
Link to page which will be prefetched and have its getInitialProps called
</a>
</DataLink>
Inspirations
- https://github.com/scaleapi/data-prefetch-link
- https://shaleenjain.com/blog/nextjs-apollo-prefetch/