Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
e2618879
Unverified
Commit
e2618879
authored
Jun 11, 2021
by
Brandon Chang
Committed by
GitHub
Jun 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update comments for clarity & grammar in router.ts (#25947)
parent
0402fc45
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
router.ts
packages/next/client/router.ts
+3
-3
No files found.
packages/next/client/router.ts
View file @
e2618879
...
...
@@ -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
...
...
@@ -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
...
...
@@ -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
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment