framework7io / framework7

Full featured HTML framework for building iOS & Android apps
http://framework7.io
MIT License
18.08k stars 3.23k forks source link

Routes don't seem to work in Framework7 CLI React starter #4289

Closed brandontle closed 1 week ago

brandontle commented 1 week ago

Describe the bug

Framework7 router doesn't seem to properly work. The URL remains unchanged when navigating via links. And entering in a URL doesn't navigate to the correct page.

To Reproduce

Steps to reproduce the behavior:

  1. Use the Framework7 CLI to create a starter: Framework7-React, Capacitor app, Tabbed views, Vite, CSS, include icons, no custom build.
  2. Start the application
  3. In the app, click on the bottom tabs. The URL will remain unchanged.
  4. Enter in a known route from ./src/js/routes.js into the URL (ex. /settings/).

Expected behavior

When clicking on the tabs below, the page and URL should change accordingly. For example, clicking on Settings should change the URL to /settings/. Likewise, manually entering /settings/ into the URL should navigate to the Settings page.

Actual Behavior

Locally, the page changes when a tab is pressed, but the URL remains unchanged. If the user enters a URL into the URL bar, the page refreshes to the current page and not the intended page.

Deployed on Vercel, the page also changes when a tab is pressed, but the URL remains unchanged. If the user enters a URL into the URL bar, a Vercel-404 page appears (ie. not the Framework7 404 page defined in ./src/pages/404.jsx).

Screenshots

Screenshot 2024-09-19 at 11 22 21

Additional context

Also tried with PWA and Single View config but same issue.

nolimits4web commented 1 week ago

Views as tabs don't support browser history. Search on the forum