framework7io / framework7

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

browserHistory throwing error when used with StrictMode #4278

Open BastianW13 opened 3 months ago

BastianW13 commented 3 months ago

Describe the bug

Trying to use View parameter browserHistory in combination with React.StrictMode runs into an error when navigating back to the previous page.

Error Message Cannot read properties of undefined (reading 'children') TypeError: Cannot read properties of undefined (reading 'children') at getChildrenArray (http://localhost:3002/slug/static/js/bundle.js:73974:26) at Router.pageComponentLoader (http://localhost:3002/slug/static/js/bundle.js:74020:30) at load (http://localhost:3002/slug/static/js/bundle.js:106505:14) at http://localhost:3002/slug/static/js/bundle.js:106626:9 at Array.forEach () at resolve (http://localhost:3002/slug/static/js/bundle.js:106623:65) at http://localhost:3002/slug/static/js/bundle.js:106719:7 at enterNextRoute (http://localhost:3002/slug/static/js/bundle.js:106791:7) at leaveCurrentRoute (http://localhost:3002/slug/static/js/bundle.js:106804:7) at Router.processRouteQueue (http://localhost:3002/slug/static/js/bundle.js:106807:3)

To Reproduce

Steps to reproduce the behavior (see codesandbox above):

  1. Navigate to either 'About' or 'Credits'
  2. Click on back arrow in NavBar component 2.1 Alternative: Use browser navigation to go back
  3. See error

Expected behavior

Navigation back to the previous page without throwing errors.

Actual Behavior

Navigation to the previous page but with errors.

Additional Context

In my actual application the navigation to the previous page still works (error messages can just be closed), but without actually updating the classes of previous-page and current-page. This leads to a frozen state, where nothing can be selected. Manually changing the previous-page class to current-page "unfreezes" the page.
However, i can not replicate that behaviour and it might not be solely related to framework7.