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

feat(gatsby-link): allow number type argument of navigate & withPrefix #24299

Closed
wants to merge 1 commit into from

Conversation

wonism
Copy link
Contributor

@wonism wonism commented May 21, 2020

Description

It should be good if navigate allows number as its argument.
With this, developer doesn't need to use window.history.go(-1);. can use just navigate(-1);.

Implementation of navigate in @reach/router looks like below.

    navigate(to, { state, replace = false } = {}) {
      if (typeof to === "number") {
        source.history.go(to);
      } else {
        ...
      }
    }

Documentation

n/a

Related Issues

n/a

@wonism wonism added the type: feature or enhancement Issue that is not a bug and requests the addition of a new feature or enhancement. label May 21, 2020
@wonism wonism requested a review from a team as a code owner May 21, 2020 13:08
@wonism wonism self-assigned this May 21, 2020
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label May 21, 2020
@pieh pieh added status: needs core review Currently awaiting review from Core team member topic: reach/router* and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels May 21, 2020
@wonism
Copy link
Contributor Author

wonism commented May 30, 2020

any feedback?

@pragmaticpat pragmaticpat added the sprint-candidate To be considered for future core sprint label May 3, 2021
@LekoArts LekoArts added topic: frontend Relates to frontend issues (e.g. reach/router, gatsby-link, page-loading, asset-loading, navigation) and removed topic: reach/router and navigation labels May 28, 2021
@LekoArts
Copy link
Contributor

This got implemented in #25611

@LekoArts LekoArts closed this Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sprint-candidate To be considered for future core sprint status: needs core review Currently awaiting review from Core team member topic: frontend Relates to frontend issues (e.g. reach/router, gatsby-link, page-loading, asset-loading, navigation) type: feature or enhancement Issue that is not a bug and requests the addition of a new feature or enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants