Props from Navigation disappear at page refresh/reload
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- javascript, react
- 領域
- frontend
調査の方向性
browserHistory と f7.views.main.router.navigate("/somePage/", {props: {id: 123}}); を使用する最小限の Framework7 React アプリから始め、ブラウザの再読み込みの前後で React DevTools または useEffect 内の props を調べます。完了条件は、直接 URL ナビゲーションを壊すことなくナビゲーション props を再読み込み後も保持できるかどうかを判断し、プロジェクトに再現テストが用意されている場合はそれを追加または更新することです。
索引モデルが issue の本文から書いたものです。
説明
- 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.
- 主要言語
- JavaScript
- スター
- 18.8k
- フォーク
- 3.2k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
framework7io/framework7 のほかの issue
-
propsHistoryオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
framework7io/framework7#4347 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
framework7io/framework7#4222 · コメント 3 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
framework7io/framework7#4175 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
framework7io/framework7#3969 · コメント 3 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
framework7io/framework7#3922 · コメント 5 件 ·
framework7io/framework7 の issue をすべて見る
似ている issue
-
refactor
難易度 2/5 半日 初心者へのやさしさ 84/100
メンテナーはふだん 5 日以内に返信
-
translation
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ciderapp/translations#87 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
component: split-view platform: windows
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
zen-browser/desktop#15616 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信