Props from Navigation disappear at page refresh/reload
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- javascript, react
- Ambito
- frontend
Direzione di ricerca
Inizia con un'app Framework7 React minima usando browserHistory e f7.views.main.router.navigate("/somePage/", {props: {id: 123}}); ispeziona le props in React DevTools o in un useEffect prima e dopo un ricaricamento del browser. Il lavoro è completato quando è stato determinato se le props di navigazione possono persistere dopo i ricaricamenti senza interrompere la navigazione diretta tramite URL, e viene aggiunto o aggiornato un test di riproduzione se il progetto ne fornisce uno.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
- 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.
- Lingua principale
- JavaScript
- Stelle
- 18.8k
- Fork
- 3.2k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di framework7io/framework7
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
framework7io/framework7#4365 · 1 commento ·
-
propsHistory Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
framework7io/framework7#4347 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
framework7io/framework7#4222 · 3 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
framework7io/framework7#4175 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
framework7io/framework7#3969 · 3 commenti ·
Tutte le issue di framework7io/framework7
Issue simili
-
Update HugeIcons library Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
antfu-collective/icones#398 ·
-
ECmail.com Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
wesbos/burner-email-providers#554 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
radiantearth/stac-browser#1023 ·
-
HMR stops working Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
components-web-app/docs#92 ·