Props from Navigation disappear at page refresh/reload
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript, react
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu với một ứng dụng Framework7 React tối thiểu sử dụng browserHistory và f7.views.main.router.navigate("/somePage/", {props: {id: 123}}); kiểm tra các props trong React DevTools hoặc một useEffect trước và sau khi tải lại trình duyệt. Hoàn tất nghĩa là xác định liệu các props điều hướng có thể tồn tại qua các lần tải lại mà không làm hỏng việc điều hướng trực tiếp bằng URL hay không, đồng thời thêm hoặc cập nhật một bài kiểm thử tái hiện nếu dự án có cung cấp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
- Framework7 version: ^8.3.4
- React.js version: ^18.3.1
- Platform and Target: Desktop App
- Live Link or CodeSandbox: Can not be replicated in Sandbox due to different behaviour when reloading the page
Describe the bug
When navigating to a route and passing props with the options
f7.views.main.router.navigate("/somePage/", {props: {id: 123}})
the props object correctly contains id. But when reloading the page (via Browser) it disappears.
Additional Information:
- I am using browserHistory as defined in the View Component. Otherwise the reload wouldn't even work as intended.
- f7router and f7route stay in the props object even after reloading
To Reproduce
Just build a simple app, try navigation with props and then reload the page. Control the contained props with React DevTools, or just log them to the console with a useEffect.
Expected behavior
The set property from navigation should stay when reloading the page.
Actual Behavior
It does not persist.
Additional context
My guess would be that this behaviour might be somewhat intended, since navigating directly to the page (via URL) does not provide any properties and distinguishing between that and a page reload could be difficult. But i think this should still work.
I will probably work around this by storing the passed property in a global store that provides it's own persistence, but i still f7 should be able to handle this.
- Ngôn ngữ chính
- JavaScript
- Star
- 18.8k
- Fork
- 3.2k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của framework7io/framework7
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
framework7io/framework7#4365 · 1 bình luận ·
-
propsHistory Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
framework7io/framework7#4347 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
framework7io/framework7#4222 · 3 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
framework7io/framework7#4175 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
framework7io/framework7#3969 · 3 bình luận ·
Tất cả issue của framework7io/framework7
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
mksglu/context-mode#1200 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
neondatabase/website#5944 ·
-
module: core
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
bigbluebutton/bigbluebutton#25849 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
jaegertracing/jaeger-ui#4506 ·