File tree Expand file tree Collapse file tree 2 files changed +20
-17
lines changed Expand file tree Collapse file tree 2 files changed +20
-17
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " webkid-react-starterkit" ,
3
- "version" : " 0.3.0 " ,
3
+ "version" : " 0.3.1 " ,
4
4
"description" : " Lightweight starting point for a react web app." ,
5
5
"keywords" : [
6
6
" react" ,
Original file line number Diff line number Diff line change 1
1
var React = require ( 'react/addons' ) ;
2
2
var objectAssign = require ( 'object-assign' ) ;
3
- var func = React . PropTypes . func ;
4
3
5
4
var stubRouterContext = ( Component , props , stubs ) => {
5
+ function RouterStub ( ) { }
6
+
7
+ objectAssign ( RouterStub , {
8
+ makePath ( ) { } ,
9
+ makeHref ( ) { } ,
10
+ transitionTo ( ) { } ,
11
+ replaceWith ( ) { } ,
12
+ goBack ( ) { } ,
13
+ getCurrentPath ( ) { } ,
14
+ getCurrentRoutes ( ) { } ,
15
+ getCurrentPathname ( ) { } ,
16
+ getCurrentParams ( ) { } ,
17
+ getCurrentQuery ( ) { } ,
18
+ isActive ( ) { } ,
19
+ } , stubs )
20
+
6
21
return React . createClass ( {
7
22
childContextTypes : {
8
- router : React . PropTypes . object
23
+ router : React . PropTypes . func
9
24
} ,
10
25
11
26
getChildContext ( ) {
12
27
return {
13
- router : objectAssign ( {
14
- makePath ( ) { } ,
15
- makeHref ( ) { } ,
16
- transitionTo ( ) { } ,
17
- replaceWith ( ) { } ,
18
- goBack ( ) { } ,
19
- getCurrentPath ( ) { } ,
20
- getCurrentRoutes ( ) { } ,
21
- getCurrentPathname ( ) { } ,
22
- getCurrentParams ( ) { } ,
23
- getCurrentQuery ( ) { } ,
24
- isActive ( ) { } ,
25
- } , stubs )
28
+ router : RouterStub
26
29
} ;
27
30
} ,
28
31
29
32
render ( ) {
30
- return < Component { ...props } />
33
+ return < Component { ...props } />
31
34
}
32
35
} ) ;
33
36
} ;
You can’t perform that action at this time.
0 commit comments