Created
February 19, 2018 23:18
-
-
Save saitonakamura/3b9e6b3c0024dcdc7fa691268ef18a79 to your computer and use it in GitHub Desktop.
Next.js on Github Pages Link wrapper example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import NextJsLink from 'next/link' | |
const assetPrefix = process.env.ASSET_PREFIX | |
const Link = ({ href, ...rest }) => ( | |
<NextJsLink href={href} as={`${assetPrefix}${href}`} {...rest} /> | |
) | |
export default Link |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment