Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX(#330): Remove useCallback hook from auth context provider #405

Merged
merged 3 commits into from
Jul 16, 2024

Conversation

chris-nowicki
Copy link
Contributor

fixes #330

Removed useCallback function from AuthContextProvider.tsx as it was not needed and it's dependencies causing more renders than needed.

Copy link

vercel bot commented Jul 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gridiron-survivor ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 16, 2024 6:23pm
gridiron-survivor-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 16, 2024 6:23pm

Copy link

appwrite bot commented Jul 15, 2024

Gridiron Survivor Application 6616ea581ef9f5521c7d

Function ID Status Action
Your function deployment has failed. Please check the logs for more details and retry.

Project name: Gridiron Survivor Application
Project ID: 6616ea581ef9f5521c7d

Function ID Status Action
userAuth 6626fef885a9f630442b failed Failed View Logs

Only deployments on the production branch are activated automatically. If you'd like to activate this deployment, navigate to your deployments. Learn more about Appwrite Function deployments.

💡 Did you know?
Cursor pagination performs better than offset pagination when loading further pages

Copy link
Contributor

@choir241 choir241 left a comment

Choose a reason for hiding this comment

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

LGTM, but do you have any screenshots of any of your tests so we can see what's happening after you removed useCallback()?

Copy link
Member

@ryandotfurrer ryandotfurrer left a comment

Choose a reason for hiding this comment

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

ezpz LGTM

@chris-nowicki
Copy link
Contributor Author

LGTM, but do you have any screenshots of any of your tests so we can see what's happening after you removed useCallback()?

I do not have screenshots. What happens is the page still loads without issues :). Really it is a behinds the scene change.

@@ -100,7 +100,7 @@ export const AuthContextProvider = ({
resetUser();
Copy link
Contributor

Choose a reason for hiding this comment

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

As always, your beautiful pieces of code gone. :) I'd love to know how you found out useCallback was causing more rendering. :)

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.

Bug: Check useCallback function to make sure it is needed
5 participants