MomenSherif / react-oauth

Google OAuth2 using the new Google Identity Services SDK for React 🚀
https://www.npmjs.com/package/@react-oauth/google
MIT License
1.13k stars 141 forks source link

About useLogin #341

Open ya3ya6 opened 8 months ago

ya3ya6 commented 8 months ago

Hey. Please follow this approach insted (for useGoogleLogin):

https://tanstack.com/query/latest/docs/framework/react/guides/mutations

suppose you have a button, you want to do login, and after that doing some afterward functions. using a useLogin for login + doing something afterward is abit odd.. developer will be like, i can't achieve this. (it's just for doing login, i can't control afterward.).

(if it's just login, it may work, but suppose it's part of a flow. currently there is no function for loginWithGoogle manually to use it on code.)

(A normal function can be exposed on custom hooks. I think mutation is a special name for doing some stuffs wit data, so it's relevant to react query.)