-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
usePathname usage in layouts breaks production builds at runtime #811
Comments
works just fine in development. an error here would be great if this is not intended usage because it's very difficult to find the root cause |
actually, it is all and any usage of usePathname |
usePathname isn't breaking when used in a client component (non navigation related) |
Please provide a full Minimal reproducible example and test on Expo Router v2 |
i can confirm that, i'm using usePathname in a layout to save an history of the visited page in the app and the backhandler to goback on hardwarebackpress. just saw your code: the problem its probably that in first moment useStoreRouteInfo() cant return anything so using usePathname in a place where this can happen throws the exception |
Please provide a reproducible example of the issue so we can investigate further. |
Which package manager are you using? (Yarn is recommended)
yarn
Summary
Expo router version ^1.4.3
Minimal reproducible example
easily reproducible. run app with expo start --no-dev
The text was updated successfully, but these errors were encountered: