-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
v3: memory location #358
v3: memory location #358
Conversation
size-limit report 📦
|
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v3 #358 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 11 11
Branches 3 3
=========================================
Hits 11 11 ☔ View full report in Codecov by Sentry. |
Co-authored-by: Alexey Taktarov <molefrog@gmail.com>
const useMemoryLocation = ({ base } = {}) => { | ||
const location = useSyncExternalStore(subscribe, () => currentPath); | ||
|
||
return [relativePath(base, location), navigate]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose navigate
method should transform the path provided using absolutePath
similarly to browser location. How to reproduce:
- Use base path
"/app"
, initial path"/app/users"
. The value returned from the hook is"/users"
. - Navigate to
"/settings"
, the path is"/settings"
(with current setup it will be"~/settings"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ready!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍾
implement #355
memory location
hook