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

Update next/router docs #14500

Closed
lfades opened this issue Jun 23, 2020 · 1 comment · Fixed by #14515
Closed

Update next/router docs #14500

lfades opened this issue Jun 23, 2020 · 1 comment · Fixed by #14515
Assignees
Milestone

Comments

@lfades
Copy link
Member

lfades commented Jun 23, 2020

Our current next/router docs (https://nextjs.org/docs/api-reference/next/router) use a combination between the useRouter hook and the Router object, ideally most examples should show the usage with useRouter as that's usually what you would need.

@lfades lfades self-assigned this Jun 23, 2020
@Timer Timer added this to the iteration 3 milestone Jun 23, 2020
@kodiakhq kodiakhq bot closed this as completed in #14515 Jun 25, 2020
kodiakhq bot pushed a commit that referenced this issue Jun 25, 2020
[ch4109]

Closes #14500

Our current docs for `next/router` use examples from both `useRouter` and `import Router from 'next/router'`, with this PR I'm unifying the API into `useRouter` (`withRouter` is still going to be mentioned multiple times as it is the HOC alternative) and no longer mentioning that you can import a global `Router` object from `next/router`, not sure if I should mention it at least once but that didn't seem to be required.

I also did some structural changes to the docs for `next/router`, now every method starts with a description, then the implementation and explanation of the parameters of the method, and then the usage example, because every method uses the same `Usage` title the hash for them would be something like `#usage`, `#usage-1`, `#usage-2`, e.t.c, so I'm not very happy with this but it looks good.

Feedback wanted 🙏
rokinsky pushed a commit to rokinsky/next.js that referenced this issue Jul 11, 2020
[ch4109]

Closes vercel#14500

Our current docs for `next/router` use examples from both `useRouter` and `import Router from 'next/router'`, with this PR I'm unifying the API into `useRouter` (`withRouter` is still going to be mentioned multiple times as it is the HOC alternative) and no longer mentioning that you can import a global `Router` object from `next/router`, not sure if I should mention it at least once but that didn't seem to be required.

I also did some structural changes to the docs for `next/router`, now every method starts with a description, then the implementation and explanation of the parameters of the method, and then the usage example, because every method uses the same `Usage` title the hash for them would be something like `#usage`, `#usage-1`, `#usage-2`, e.t.c, so I'm not very happy with this but it looks good.

Feedback wanted 🙏
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants