Skip to content

Conversation

@Migggz
Copy link

@Migggz Migggz commented Dec 17, 2025

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Dec 17, 2025

⚠️ No Changeset found

Latest commit: 92546b5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Dec 17, 2025

@Migggz is attempting to deploy a commit to the momensherif's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Migggz
Copy link
Author

Migggz commented Dec 18, 2025

@MomenSherif The only thing left is updating the root README.md to reflect that we now have two packages: one for Google and one for GitHub.

We can add a few simple usage snippets for each, along with links to their individual READMEs so users can check the full documentation.

I’ll leave this part to you if you want, or I can handle it myself, whatever works for you 😄

@MomenSherif
Copy link
Owner

I would love if you can do it 🙌🏻،

Have separate README for each package guide inside the package.

And the root README, shows the two packages and links for each doc

@MomenSherif MomenSherif self-requested a review December 21, 2025 20:11
setIsLoading(false);
onError(error instanceof Error ? error : new Error(String(error)));
}
}, [options, state, isLoading]);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Memoization here will not work, as options most probably users will pass at as plain object, and it will be with new reference every time.

the object here will be with new reference each time

  const { initiateGitHubLogin, isLoading } = useGitHubLogin({
    clientId: 'xxxxx',
    redirectUri: 'http://localhost:3000/callback',
    onSuccess: response => {
      console.log('Success:', response);
    },
    onError: error => {
      console.error('Error:', error);
    },
  });

we will need to explicitly have each option in the deps array, and for callbacks as we don't want the user of the hook to use useCallback to memoize the onSuccess, onError and onRequest

we can have them like this, similar what we do in useGoogleLogin hook

  const onSuccessRef = useRef(onSuccess);
  onSuccessRef.current = onSuccess;

or have this custom hook https://gist.github.com/MomenSherif/d6193f21e0c0c496fde7ab9ba7d0755a, will help us avoid rerender because of inline methods as parameters

@MomenSherif
Copy link
Owner

@Migggz Thank you for the effort ❤️, really appreciated.

left 2 small comments, we can proceed with them.
and if we can fix the conflicts in README. Sorry for that 😅. as there a fix just merged.

and will release it after that

…cements

- Removed GithubLoginButton
- Simplified Building Github OAuth URL using URLSearchParams
-
Simplified OAuthError Builder and its states
- Refactor PopupWindow and Simplified the code
-
Updated README accordingly

BREAKING CHANGE: Removed the GithubLoginButton
…seGitHubLogin options handling

- Adjusted PopupWindow dimensions for better user experience.
- Refactored useGitHubLogin to
extract individual options and utilize refs for callbacks.
@Migggz
Copy link
Author

Migggz commented Dec 22, 2025

@MomenSherif Nice catch 😄
I've finalized the two comments, and also rebased on the latest master and resolved the conflict.

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.

2 participants