Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix href link to Nextjs link #74

Closed
wants to merge 6 commits into from
Closed

Conversation

thuyvy3110
Copy link
Collaborator

Change all hash href link from normal link a to Nextjs Link #43

@thuyvy3110 thuyvy3110 added the enhancement New feature or request label Dec 17, 2019
@thuyvy3110 thuyvy3110 self-assigned this Dec 17, 2019
@vercel
Copy link

vercel bot commented Dec 17, 2019

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/monkeybear/phatho-porfolio-nextjs/h0ipj4w7b
🌍 Preview: https://phatho-porfolio-nextjs-git-fix-href-to-nextjs-link.monkeybear.now.sh

@DeKal
Copy link
Owner

DeKal commented Dec 17, 2019

The test case is failed because we trying to use Link while mock a click to redirect with Jest
vercel/next.js#1827 (comment)
see link for related solution

const actionWithPromise = () => {
  return new Promise((resolve) => resolve());
};

const mockedRouter = {
  push: actionWithPromise,
  replace: actionWithPromise,
  prefetch: () => {},
};

// @ts-ignore
Router.router = mockedRouter

@thuyvy3110
Copy link
Collaborator Author

Using Link Nextjs could not help the Scroll more smoothly, it's better to use Link to link two or more pages but in our case no useful here

@thuyvy3110 thuyvy3110 closed this Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants