forked from remix-run/history
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
27 lines (24 loc) · 672 Bytes
/
index.html
File metadata and controls
27 lines (24 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<html>
<head>
<script src="/bundle.js"></script>
<script>
var createHistory = History.createBrowserHistory
var page = 0
var h = createHistory()
h.block(function (location, action) {
return 'Are you sure you want to go to ' + location.path + '?'
})
h.listen(function (location) {
console.log(location)
})
</script>
</head>
<body>
<p>Use the two buttons below to test normal transitions.</p>
<p>
<button onclick="page++; h.push('/' + page, { page: page })">history.push</button>
<button onclick="h.goBack()">history.goBack</button>
</p>
</body>
</html>