Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Props from Navigation disappear at page refresh/reload

Đang mở
#4,332 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của framework7io/framework7

Tất cả issue của framework7io/framework7

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.