From 7b5d72dbe44e0de2e5159de388c4eb31911f0a2a Mon Sep 17 00:00:00 2001 From: Andy Slezak Date: Sun, 4 Feb 2018 14:34:12 -0500 Subject: [PATCH 1/2] Add example for gatsby-browser.js API shouldUpdateScroll --- packages/gatsby/src/utils/api-browser-docs.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/gatsby/src/utils/api-browser-docs.js b/packages/gatsby/src/utils/api-browser-docs.js index d14771b52f708..48c358ead6183 100644 --- a/packages/gatsby/src/utils/api-browser-docs.js +++ b/packages/gatsby/src/utils/api-browser-docs.js @@ -35,6 +35,11 @@ exports.onRouteUpdate = true * @param {object} $0 * @param {object} $0.prevRouterProps The previous state of the router before the route change. * @param {object} $0.pathname The new pathname + * @example + * exports.shouldUpdateScroll = (prevRouterProps, pathname) => { + * window.scrollTo(0, 0) // upon navigation, scroll to top of page + * return false + * }; */ exports.shouldUpdateScroll = true From 3154a9d44b4dd233b7cb9dacc9605899d40844c6 Mon Sep 17 00:00:00 2001 From: Andy Slezak Date: Mon, 5 Feb 2018 17:03:09 -0500 Subject: [PATCH 2/2] add www.aslezak.com to showcase --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b598cdb8632a9..5cdd716e32508 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,7 @@ Websites built with Gatsby: * [ERC dEX](https://ercdex.com) * [iContract Blog](https://blog.icontract.co.uk) * [Dona Rita](https://donarita.co.uk) ([source](https://github.com/peduarte/dona-rita-website)) +* [Andy Slezak](https://www.aslezak.com) ([source](https://github.com/amslezak)) ## Docs