We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi!
"useUser" hook has "id" as an input argument
function useUser (id) { const { data, error, isLoading } = useSWR(`/api/user/${id}`, fetcher) return { user: data, isLoading, isError: error } }
but components "Avatar" and "Content" call it without arguments.
function Content () { const { user, isLoading } = useUser() if (isLoading) return <Spinner /> return <h1>Welcome back, {user.name}</h1> }
How does it work?
The text was updated successfully, but these errors were encountered:
Thank you! This example should be useUser(id), I'll fix it.
useUser(id)
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Hi!
"useUser" hook has "id" as an input argument
but components "Avatar" and "Content" call it without arguments.
How does it work?
The text was updated successfully, but these errors were encountered: