这是indexloc提供的服务,不要输入任何密码
Skip to content

docs: Add useRouter Documentation #325

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

Merged
merged 5 commits into from
Jan 13, 2025

Conversation

jacobhq
Copy link
Contributor

@jacobhq jacobhq commented Jan 13, 2025

Context & Description

See this discord thread. This PR adds documentation for the useRouter hook, including an example, documentation for the returned router object, and all methods returned (so far only router.push).

I like to rebase and squash PRs into one commit because I think it keeps history cleaner, so it might be a bit messy until I do that :)

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jan 13, 2025
@jacobhq
Copy link
Contributor Author

jacobhq commented Jan 13, 2025

A couple of things I noticed:

  • pathname doesn't use camel case
  • Return type of query (Record<string, unknown>) is actually Record<string, string> I think

Should I change these here, or file a separate PR?

Copy link
Member

@Valerioageno Valerioageno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments. Happy to hear your thoughts on them!

P.S. No worries for squashing your commits. They are automatically squashed on PR merge

@jacobhq
Copy link
Contributor Author

jacobhq commented Jan 13, 2025

Thanks for your comments, I've implemented them, and they've let me make that example much simpler!

@Valerioageno
Copy link
Member

Thanks for addressing this!

@Valerioageno Valerioageno merged commit d6fae42 into tuono-labs:main Jan 13, 2025
4 checks passed
@jacobhq jacobhq deleted the jm-userouter-docs branch January 13, 2025 18:09
@marcalexiei
Copy link
Collaborator

Regarding #325 (comment)

pathname doesn't use camel case

pathname is the standard name so it should remain the same.
Refer to the following links for more information:


Return type of query (Record<string, unknown>) is actually Record<string, string> I think

You can submit a separate PR for addressing this type refine. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants