Skip to content

Conversation

z3ttee
Copy link

@z3ttee z3ttee commented Aug 26, 2025

Hey all, I used convex for some weeks now and came across the <Unauthenticated /> react component.
I noticed when using SSR in NextJS there is a short time window where the page renders nothing when using said component together with <Authenticated />. I looked into the code and found out, that when the authentication state is loading, neither of said components render anything.

To have more control over this and to fix this small issue I want to introduce a prop on the <Unauthenticated /> component.

How does it work?
With the prop loadingEqualsUnauthenticated developers can decide wether they want to treat the loading state as unauthenticated or not. So when this gets set to true, the loading state is ignored and the children are rendered to the DOM.
This option defaults to false, so this should not be a breaking change. This is something similar to what Clerk provides through their built-in components: loadingEqualsUnauthenticated

Please let me know what you think of this change. Any feedback is welcome.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant