@@ -49,6 +49,25 @@ const NewTabPage = React.createClass({
49
49
const recommendationIcon = props . Spotlight . recommendationShown ? "check" : " " ;
50
50
const showRecommendationOption = props . showRecommendationOption ;
51
51
52
+ // XXX forcibly add # on the server side so that it makes the # added on the
53
+ // client side by react-router's createHref() to make pre-rendered and
54
+ // dynamically rendered html completely identical so that React doesn't try
55
+ // to go to heroical measures to fix things up and (presumably) slow down
56
+ // the pre-render. If we decide to stick with this hack, we need to be
57
+ // sure it's not necessary for any other <Link>s in the code.
58
+ //
59
+ // See https://github.com/reactjs/react-router/issues/2111 and
60
+ // http://stackoverflow.com/questions/27928372/react-router-urls-dont-work-when-refreshing-or-writting-manually
61
+ // for some relevant info.
62
+ let debugLinkTo , timelineLinkTo ;
63
+ if ( PRERENDER ) {
64
+ debugLinkTo = "#/debug" ;
65
+ timelineLinkTo = "#/timeline" ;
66
+ } else {
67
+ debugLinkTo = "/debug" ;
68
+ timelineLinkTo = "/timeline" ;
69
+ }
70
+
52
71
return ( < main className = "new-tab" >
53
72
< div className = "new-tab-wrapper" >
54
73
< section >
@@ -77,7 +96,9 @@ const NewTabPage = React.createClass({
77
96
</ section >
78
97
79
98
< section className = "bottom-links-container" >
80
- < Link className = "bottom-link" to = "/timeline" > < span className = "icon icon-spacer icon-activity-stream" /> See all activity</ Link >
99
+ < Link className = "bottom-link" to = { timelineLinkTo } >
100
+ < span className = "icon icon-spacer icon-activity-stream" /> See all activity
101
+ </ Link >
81
102
< span className = "link-wrapper-right" >
82
103
< a
83
104
ref = "settingsLink"
@@ -98,7 +119,7 @@ const NewTabPage = React.createClass({
98
119
</ div >
99
120
</ div >
100
121
101
- < Link className = "debug-link" to = "/debug" > debug</ Link >
122
+ < Link className = "debug-link" to = { debugLinkTo } > debug</ Link >
102
123
</ main > ) ;
103
124
}
104
125
} ) ;
0 commit comments