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

Expose shallow routing as a prop. #139

Merged
merged 4 commits into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ See [atomFamily](https://recoiljs.org/docs/api-reference/utils/atomFamily) for m

#### Return

A function which takes `paramter` that map to an atom, and its `initialValue`.
A function which takes `parameter` that map to an atom, and its `initialValue`.

#### Example

Expand Down
10 changes: 8 additions & 2 deletions src/url/useSyncURLNext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,15 @@ export function useSyncURLNext(): Partial<
}, [])

const browserInterface: BrowserInterface = {
replaceURL: useCallback((url: string) => replace(url), [replace]),
replaceURL: useCallback(
(url: string) => replace(url, undefined, { shallow: true }),
[replace]
),

pushURL: useCallback((url: string) => push(url), [push]),
pushURL: useCallback(
(url: string) => push(url, undefined, { shallow: true }),
[push]
),

getURL: useCallback(() => {
const url = new URL(
Expand Down