File tree Expand file tree Collapse file tree 12 files changed +24
-23
lines changed
passing-props-to-children Expand file tree Collapse file tree 12 files changed +24
-23
lines changed Original file line number Diff line number Diff line change 1
1
import React , { cloneElement } from 'react/addons' ;
2
- import HashHistory from 'react-router/lib/HashHistory' ;
2
+ import { history } from 'react-router/lib/HashHistory' ;
3
3
import { Router , Route , Link } from 'react-router' ;
4
4
5
5
var { CSSTransitionGroup } = React . addons ;
@@ -46,7 +46,7 @@ var Page2 = React.createClass({
46
46
47
47
48
48
React . render ( (
49
- < Router history = { new HashHistory } >
49
+ < Router history = { history } >
50
50
< Route path = "/" component = { App } >
51
51
< Route path = "page1" component = { Page1 } />
52
52
< Route path = "page2" component = { Page2 } />
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import HashHistory from 'react-router/lib/HashHistory' ;
2
+ import { history } from 'react-router/lib/HashHistory' ;
3
3
import { Router , Route , Link , Navigation } from 'react-router' ;
4
4
import { loadContacts , loadContact , createContact } from './utils' ;
5
5
import AsyncProps from 'react-router/lib/experimental/AsyncProps' ;
@@ -106,7 +106,7 @@ var Index = React.createClass({
106
106
} ) ;
107
107
108
108
React . render ( (
109
- < Router history = { new HashHistory } createElement = { AsyncProps . createElement } >
109
+ < Router history = { history } createElement = { AsyncProps . createElement } >
110
110
< Route component = { AsyncProps } renderInitialLoad = { ( ) => < Spinner /> } >
111
111
< Route component = { App } >
112
112
< Route path = "/" component = { Index } />
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React, { findDOMNode } from 'react';
2
2
import { Router , Route , Link , Navigation } from 'react-router' ;
3
3
import HashHistory from 'react-router/lib/HashHistory' ;
4
4
import auth from './auth' ;
5
+ var history = new HashHistory ( { queryKey : true } ) ;
5
6
6
7
var App = React . createClass ( {
7
8
getInitialState ( ) {
@@ -120,7 +121,7 @@ function requireAuth(nextState, transition) {
120
121
}
121
122
122
123
React . render ( (
123
- < Router history = { new HashHistory ( { queryKey : true } ) } >
124
+ < Router history = { history } >
124
125
< Route path = "/" component = { App } >
125
126
< Route path = "login" component = { Login } />
126
127
< Route path = "logout" component = { Logout } />
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import HashHistory from 'react-router/lib/HashHistory' ;
2
+ import { history } from 'react-router/lib/HashHistory' ;
3
3
import { Router , Route , Link , Redirect } from 'react-router' ;
4
4
5
5
var App = React . createClass ( {
@@ -47,7 +47,7 @@ var Task = React.createClass({
47
47
} ) ;
48
48
49
49
React . render ( (
50
- < Router history = { new HashHistory } >
50
+ < Router history = { history } >
51
51
< Route path = "/" component = { App } >
52
52
< Route path = "user/:userID" component = { User } >
53
53
< Route path = "tasks/:taskID" component = { Task } />
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import HashHistory from 'react-router/lib/HashHistory' ;
2
+ import { history } from 'react-router/lib/HashHistory' ;
3
3
import { Router } from 'react-router' ;
4
4
import AsyncProps from 'react-router/lib/experimental/AsyncProps' ;
5
5
import stubbedCourses from './stubs/COURSES' ;
@@ -28,7 +28,7 @@ var rootRoute = {
28
28
React . render ( (
29
29
< Router
30
30
routes = { rootRoute }
31
- history = { new HashHistory }
31
+ history = { history }
32
32
createElement = { AsyncProps . createElement }
33
33
/>
34
34
) , document . getElementById ( 'example' ) ) ;
Original file line number Diff line number Diff line change 1
1
import React , { findDOMNode } from 'react' ;
2
- import HashHistory from 'react-router/lib/HashHistory' ;
2
+ import { history } from 'react-router/lib/HashHistory' ;
3
3
import { Router , Navigation , Route , Link } from 'react-router' ;
4
4
import ContactStore from './ContactStore' ;
5
5
@@ -150,7 +150,7 @@ var NotFound = React.createClass({
150
150
} ) ;
151
151
152
152
React . render ( (
153
- < Router history = { new HashHistory } >
153
+ < Router history = { history } >
154
154
< Route component = { App } >
155
155
< Route path = "/" component = { Index } />
156
156
< Route path = "contact/new" component = { NewContact } />
Original file line number Diff line number Diff line change 1
1
var React = require ( 'react' ) ;
2
- import HashHistory from 'react-router/lib/HashHistory' ;
2
+ import { history } from 'react-router/lib/HashHistory' ;
3
3
var { Router, Route, Link, Navigation } = require ( 'react-router' ) ;
4
4
5
5
var App = React . createClass ( {
@@ -72,7 +72,7 @@ var Taco = React.createClass({
72
72
} ) ;
73
73
74
74
React . render ( (
75
- < Router history = { new HashHistory } >
75
+ < Router history = { history } >
76
76
< Route path = "/" component = { App } >
77
77
< Route path = "taco/:name" component = { Taco } />
78
78
</ Route >
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { Router , Link } from 'react-router' ;
3
3
import HashHistory from 'react-router/lib/HashHistory' ;
4
+ var history = new HashHistory ( { queryKey : 'k' } ) ;
4
5
5
6
var pictures = [
6
7
{ id : 0 , src : 'http://placekitten.com/601/601' } ,
@@ -127,7 +128,7 @@ var RootRoute = {
127
128
} ;
128
129
129
130
React . render (
130
- < Router history = { new HashHistory ( { queryKey : 'k' } ) } children = { RootRoute } /> ,
131
+ < Router history = { history } children = { RootRoute } /> ,
131
132
document . getElementById ( 'example' )
132
133
) ;
133
134
@@ -160,4 +161,3 @@ React.render(
160
161
//
161
162
// 10. I am very glad there aren't ten steps to explain this ...
162
163
//
163
-
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import HashHistory from 'react-router/lib/HashHistory' ;
2
+ import { history } from 'react-router/lib/HashHistory' ;
3
3
import { Router , Route , Link } from 'react-router' ;
4
4
5
5
var User = React . createClass ( {
@@ -32,7 +32,7 @@ var App = React.createClass({
32
32
} ) ;
33
33
34
34
React . render ( (
35
- < Router history = { new HashHistory } >
35
+ < Router history = { history } >
36
36
< Route path = "/" component = { App } >
37
37
< Route path = "user/:userID" component = { User } />
38
38
</ Route >
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import HashHistory from 'react-router/lib/HashHistory' ;
2
+ import { history } from 'react-router/lib/HashHistory' ;
3
3
import { Router , Route , Link } from 'react-router' ;
4
4
5
5
var App = React . createClass ( {
@@ -70,7 +70,7 @@ var ForgotPassword = React.createClass({
70
70
} ) ;
71
71
72
72
React . render ( (
73
- < Router history = { new HashHistory } >
73
+ < Router history = { history } >
74
74
< Route path = "/" component = { App } >
75
75
< Route component = { SignedOut } >
76
76
< Route path = "signin" component = { SignIn } />
You can’t perform that action at this time.
0 commit comments