Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(gatsby-react-router-scroll): Add documentation for scroll restoration options #25450

Merged
merged 11 commits into from
Jul 10, 2020

Conversation

blainekasten
Copy link
Contributor

@blainekasten blainekasten commented Jul 1, 2020

Description

Adds useScrollRestoration to main exports from gatsby
Adds a small intro to our scroll restoration. Turns out we weren't documenting these anywhere.

Clubhouse ticket: https://app.clubhouse.io/gatsbyjs/story/9575/add-documentation-for-usescrollrestoration

Documentation

Related Issues

#24306

@blainekasten blainekasten requested a review from a team as a code owner July 1, 2020 19:02
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jul 1, 2020
@blainekasten blainekasten requested a review from a team as a code owner July 1, 2020 19:12
docs/docs/reach-router-and-gatsby.md Outdated Show resolved Hide resolved
@madalynrose madalynrose added status: inkteam assigned and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jul 1, 2020
@@ -11,6 +11,7 @@ The main reasons Gatsby uses `@reach/router` are:
1. Preloading. You can read more about preloading in the docs for the [Gatsby Link API](https://www.gatsbyjs.org/docs/gatsby-link/).
2. The [routing accessibility](https://reach.tech/router/accessibility) it provides.
3. It supports [server rendering](https://reach.tech/router/server-rendering) which helps Gatsby build routed files at build time.
4. Scroll restoration.
Copy link

@AishaBlake AishaBlake Jul 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably have a full sentence with a link to learn more, like the other list items. I wouldn't necessarily expect all (or even most?) of the people reading this know what scroll restoration is. What does using scroll restoration let us do? The link could be to the Reach docs or just the relevant section below.

Suggested change
4. Scroll restoration.
4. It supports [scroll restoration](), which allows Gatsby to better control pages' scroll position.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this change, but I don't really know what to link to. Maybe this? https://reacttraining.com/react-router/web/guides/scroll-restoration

Copy link

@AishaBlake AishaBlake Jul 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry! Yes, that's exactly what I meant by "Reach docs". That was, in no way, clear. 😳

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw that's react router docs. Reach doesn't have a section on scroll restoration

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That... is true. It is the page I was thinking of, regardless. 😅

@blainekasten blainekasten requested a review from a team as a code owner July 6, 2020 19:26
@gatsby-cloud-staging
Copy link

gatsby-cloud-staging bot commented Jul 6, 2020

Your pull request can be previewed in Gatsby Cloud: https://build-66bc3ec4-397c-4d59-9429-dc357b179644.staging-previews.gtsb.io

@blainekasten blainekasten dismissed madalynrose’s stale review July 8, 2020 14:43

completed change requested

Copy link
Contributor

@smthomas smthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@blainekasten blainekasten merged commit 73ebb1e into master Jul 10, 2020
@delete-merged-branch delete-merged-branch bot deleted the docs/useScrollRestoration branch July 10, 2020 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants