Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

browserHistory throwing error when used with StrictMode #4278

Open
BastianW13 opened this issue Jul 5, 2024 · 0 comments
Open

browserHistory throwing error when used with StrictMode #4278

BastianW13 opened this issue Jul 5, 2024 · 0 comments

Comments

@BastianW13
Copy link

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.

@framework7io framework7io deleted a comment from 1619626107 Jul 15, 2024
@framework7io framework7io deleted a comment from 1619626107 Jul 15, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant