Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
react-live-route
Overview
Overview
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
fukai
react-live-route
Commits
1242da81
Commit
1242da81
authored
Jan 24, 2019
by
Wee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs(README): update README
parent
12ef6cd4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletions
+20
-1
README.md
README.md
+19
-0
package-lock.json
example/package-lock.json
+0
-0
index.js
example/src/index.js
+1
-1
No files found.
README.md
View file @
1242da81
...
...
@@ -93,6 +93,25 @@ This hook will be triggered when LiveRoute will hide in `componentWillReceivePro
This hook will be triggered when LiveRoute will reappear from hide in
`componentWillReceiveProps`
stage (so it happens before re-render).
```
js
import
LiveRoute
from
'react-live-route'
<
LiveRoute
path
=
"/items"
component
=
{
List
}
livePath
=
"/item/:id"
name
=
"items"
onHide
=
{
routeState
=>
{
console
.
log
(
'[on hide]'
)
console
.
log
(
routeState
)
}}
onReappear
=
{
routeState
=>
{
console
.
log
(
'[on reappear]'
)
console
.
log
(
routeState
)
}}
/
>
```
## TODO
-
[
]
add test case
...
...
example/package-lock.json
0 → 100644
View file @
1242da81
This source diff could not be displayed because it is too large. You can
view the blob
instead.
example/src/index.js
View file @
1242da81
...
...
@@ -48,5 +48,5 @@ if ('scrollRestoration' in window.history) {
}
document
.
addEventListener
(
'scrollTo'
,
()
=>
{
console
.
log
(
'
233
'
)
console
.
log
(
'
document scrolled
'
)
})
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