Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

Add replace option to navigate#197

Merged
DAreRodz merged 6 commits intomain-wp-directives-pluginfrom
navigate-replace-option
Mar 30, 2023
Merged

Add replace option to navigate#197
DAreRodz merged 6 commits intomain-wp-directives-pluginfrom
navigate-replace-option

Conversation

@DAreRodz
Copy link
Copy Markdown
Collaborator

This PR adds a replace option to the router's navigate function.

When the option value is false (default), the function calls history.pushState.

When set to true, it calls history.replaceState instead.

The idea of naming that option replace is based on what React Router does for its navigate, or Next.js does for its Link component.

Copy link
Copy Markdown
Member

@luisherranz luisherranz left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks David 🎉

DAreRodz and others added 3 commits March 28, 2023 16:30
Co-authored-by: Luis Herranz <luisherranz@gmail.com>
Co-authored-by: Luis Herranz <luisherranz@gmail.com>
Co-authored-by: Luis Herranz <luisherranz@gmail.com>
@DAreRodz DAreRodz merged commit baa9c1e into main-wp-directives-plugin Mar 30, 2023
@DAreRodz DAreRodz deleted the navigate-replace-option branch March 30, 2023 11:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants