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

Add search params (query params) support #43

Closed

Conversation

skoshy
Copy link

@skoshy skoshy commented Aug 26, 2019

This option keeps URL search params in the history and prevents them from being overwritten when react-albus handles navigation. This handles issue #36.

This feature is very useful when you have a unique link identifier for a user and you want to preserve it in the URL so they can share it with others or return back to it with that data still present in the url.

@CLAassistant
Copy link

CLAassistant commented Aug 26, 2019

CLA assistant check
All committers have signed the CLA.

@ldthorne
Copy link

This would be great to have! We built something around this @HiCommon

@github-actions
Copy link

github-actions bot commented Apr 7, 2020

This pull request is stale because it has been open 30 days with no activity. Remove no-pr-activity label or comment or this will be closed in 5 days.

@github-actions
Copy link

This pull request is stale because it has been open 30 days with no activity.

}
});
};

push = (step = this.nextStep) => this.history.push(`${this.basename}${step}`);
replace = (step = this.nextStep) => this.history.replace(`${this.basename}${step}`);
push = (step = this.nextStep) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

history.replace and history.push can accept a location-like object which will preserve query params. check out https://github.com/ReactTraining/history/tree/v4.6.0#navigation. Using this, you can remove historySuffix and do something like this:

replace = (step = this.nextStep) => {
  if (this.props.preserveSearch) {
    this.history.replace({
      ...this.history.location,
      pathname:`${this.basename}${step}`
    })
  } else {
    this.history.replace(`${this.basename}${step}`);
  }
}

Base automatically changed from master to main March 4, 2021 17:04
@ryhinchey ryhinchey requested a review from a team as a code owner March 4, 2021 17:04
@ryhinchey
Copy link
Contributor

@skoshy I know it's been forever. Apologies for no one getting to this faster. Are you still interested in working on this?

@github-actions
Copy link

github-actions bot commented Aug 5, 2023

This pull request is stale because it has been open 30 days with no activity.

@code-forger code-forger added the Contribution For contributions from outside the github team label Aug 17, 2023
@teofanis
Copy link
Contributor

teofanis commented Aug 23, 2023

@ryhinchey I could continue if this is still needed and @skoshy is ok with it?

@github-actions github-actions bot removed the stale-pr label Aug 24, 2023
@skoshy
Copy link
Author

skoshy commented Aug 24, 2023

Hi! I've lost context on this and am not working with the library recently, so someone else can feel free to take it over and close this PR.

@Matthew-Mallimo
Copy link
Member

Closing until someone can pick this back up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribution For contributions from outside the github team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants