@@ -40,12 +40,9 @@ const onPreRouteUpdate = (location, prevLocation) => {
40
40
}
41
41
}
42
42
43
- const onRouteUpdate = ( location , prevLocation , announceLocation ) => {
43
+ const onRouteUpdate = ( location , prevLocation ) => {
44
44
if ( ! maybeRedirect ( location . pathname ) ) {
45
45
apiRunner ( `onRouteUpdate` , { location, prevLocation } )
46
- if ( announceLocation ) {
47
- announceLocation ( )
48
- }
49
46
// Temp hack while awaiting https://github.com/reach/router/issues/119
50
47
window . __navigatingToLink = false
51
48
}
@@ -165,12 +162,10 @@ class RouteAnnouncer extends React.Component {
165
162
constructor ( props ) {
166
163
super ( props )
167
164
this . state = { announcement : `` }
168
- console . log ( `constructor` )
169
165
}
170
166
171
167
componentDidUpdate ( prevProps ) {
172
168
requestAnimationFrame ( ( ) => {
173
- console . log ( `updating` , this . props . location . pathname )
174
169
let pageName = `new page at ${ this . props . location . pathname } `
175
170
if ( document . title ) {
176
171
pageName = document . title
@@ -183,7 +178,6 @@ class RouteAnnouncer extends React.Component {
183
178
}
184
179
let newAnnouncement = `Navigated to ${ pageName } `
185
180
if ( this . state . announcement !== newAnnouncement ) {
186
- console . log ( `setting state` , this . state . announcement , newAnnouncement )
187
181
this . setState ( {
188
182
announcement : newAnnouncement ,
189
183
} )
@@ -192,7 +186,6 @@ class RouteAnnouncer extends React.Component {
192
186
}
193
187
194
188
render ( ) {
195
- console . log ( `rendering` , this . props . location . pathname )
196
189
const { announcement } = this . state
197
190
return (
198
191
< div
0 commit comments