Beginner question #824
Unanswered
PeterPanen
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there.
I am still fairly new to Hooks in general and trying to improve and learn so bear with me.
Would the following way of inlining and wrapping the mutate function in my custom useUser hook, have any bad consequence?
It seems to work great, and it makes it really easy to consume my custom hook and handle both GET and POST when authenticating.
This way i can do
const { user, login } = useUser()
and access user and invoke login very easy, but i'm not sure if its bad practice in some way. Maybe creating a lot of anonymous functions on each hook cycle or something?Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions