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 comments for clarity & grammar in router.ts #25947

Merged
merged 4 commits into from
Jun 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/next/client/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Object.defineProperty(singletonRouter, 'events', {
})

urlPropertyFields.forEach((field: string) => {
// Here we need to use Object.defineProperty because, we need to return
// Here we need to use Object.defineProperty because we need to return
// the property assigned to the actual router
// The value might get changed as we change routes and this is the
// proper way to access it
Expand Down Expand Up @@ -112,7 +112,7 @@ function getRouter(): Router {
if (!singletonRouter.router) {
const message =
'No router instance found.\n' +
'You should only use "next/router" inside the client side of your app.\n'
'You should only use "next/router" on the client side of your app.\n'
throw new Error(message)
}
return singletonRouter.router
Expand All @@ -134,7 +134,7 @@ export function useRouter(): NextRouter {

// Create a router and assign it as the singleton instance.
// This is used in client side when we are initilizing the app.
// This should **not** use inside the server.
// This should **not** be used inside the server.
export const createRouter = (...args: RouterArgs): Router => {
singletonRouter.router = new Router(...args)
singletonRouter.readyCallbacks.forEach((cb) => cb())
Expand Down