Skip to content

Commit

Permalink
fix(docs): Don’t include example code in API docs that doesn’t work (#…
Browse files Browse the repository at this point in the history
…15803)

Was showing someone how to use `onRouteUpdate` and copied the code and was surprised to see a wall of errors in their browser console.
  • Loading branch information
KyleAMathews authored and m-allanson committed Jul 17, 2019
1 parent e774bf7 commit 044eea5
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions packages/gatsby/src/utils/api-browser-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,6 @@ exports.onRouteUpdateDelayed = true
* exports.onRouteUpdate = ({ location, prevLocation }) => {
* console.log('new pathname', location.pathname)
* console.log('old pathname', prevLocation ? prevLocation.pathname : null)
*
* // Track pageview with google analytics
* window.ga(
* `set`,
* `page`,
* location.pathname + location.search + location.hash,
* )
* window.ga(`send`, `pageview`)
* }
*/
exports.onRouteUpdate = true
Expand Down

0 comments on commit 044eea5

Please sign in to comment.