File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
1
var React = require ( 'react' ) ;
2
+ var copyProperties = require ( 'react/lib/copyProperties' ) ;
2
3
3
4
function routeIsActive ( activeRoutes , routeName ) {
4
5
return activeRoutes . some ( function ( route ) {
@@ -49,24 +50,24 @@ var ActiveContext = {
49
50
} ,
50
51
51
52
/**
52
- * Returns an array of the currently active routes.
53
+ * Returns a read-only array of the currently active routes.
53
54
*/
54
55
getActiveRoutes : function ( ) {
55
- return this . state . activeRoutes ;
56
+ return this . state . activeRoutes . slice ( 0 ) ;
56
57
} ,
57
58
58
59
/**
59
- * Returns an object of the currently active URL parameters.
60
+ * Returns a read-only object of the currently active URL parameters.
60
61
*/
61
62
getActiveParams : function ( ) {
62
- return this . state . activeParams ;
63
+ return copyProperties ( { } , this . state . activeParams ) ;
63
64
} ,
64
65
65
66
/**
66
- * Returns an object of the currently active query parameters.
67
+ * Returns a read-only object of the currently active query parameters.
67
68
*/
68
69
getActiveQuery : function ( ) {
69
- return this . state . activeQuery ;
70
+ return copyProperties ( { } , this . state . activeQuery ) ;
70
71
} ,
71
72
72
73
/**
You can’t perform that action at this time.
0 commit comments