React & firebase auth - login redirect delay

Hi pro-react-js developers.
I’m Md Mamun Islam a new react-js student.

I’m trying to use firebase auth with react-js. But I’m facing a issue with “signInWithRedirect”. After authentication there is a few second delay in login. For that time the login button remains clickable. This problem can confuse the user’s.

http://ligchat.netlify.app

Firebase recently released there V9. This makes all other tutorials obsolete. Now I’m reading docs, which is hard for me to follow.

If I missed solution for this problem in docs please send me the link.

If anyone has any solution please help me.

Can’t you just disable the button in the handler function? Add a ref to the button and use that to set the disabled attribute.

You might even do some more fancy UX where you disable the button and add a little loading spinner inside it, or at least show some sort of loading indicator somewhere in the UI.

1 Like

Thanks for your solution. It was in my mind, but I was wondering if I could reduce that delay.

But there seems to be no solution to this problem other than creating a loading state as discussed in this github issue.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.