Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Props from Navigation disappear at page refresh/reload

Aperta
#4,332 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di framework7io/framework7

Tutte le issue di framework7io/framework7

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.