Closed david-roeger closed 1 year ago
I don't think your repo has the code you mentioned.
I want to implement Authentification and thus redirect the users from the home screen if they are not logged in.
I don't typically recommend this pattern. In my Next.js Conf talk on Oct 25, I outline a different way to approach this.
I don't think your repo has the code you mentioned.
I forgot to commit the changes. They are available now... Sorry for the inconvenience
I don't typically recommend this pattern. In my Next.js Conf talk on Oct 25, I outline a different way to approach this.
That's exciting to hear. Looking forward to your talk 🤩
Hey all, please see my latest talk on how to gate content for auth. Rather that using replace redirects, it uses conditional rendering. This is a better approach for React in my opinion. Hope it helps!
Hi,
I want to implement Authentification and thus redirect the users from the home screen if they are not logged in. Therefore I show a loading screen and check in an
useEffect
if the user is present and if not i want to redirect them to the login screen:Unfortunately this throws an Error on iOS and Android concerning
react-navigation
Error
Stacktrace
The Error references https://reactnavigation.org/docs/navigating-without-navigation-prop#handling-initialization. Maybe this issue can be solved by additionally returning an
isReady
Prop fromuseRouter
?Reproduction
https://github.com/david-roeger/solito-redirect-error
I cloned the starter repo and added the following to
home/screen.tsx
Thanks in advance!