Skip to main content

Overview

useUserDetails hook is used to fetch and manage the user details. It leverages the react-query library to handle the asynchronous operation and provides error handling and success callbacks.

Example Usage

user-details-component.tsx

Parameters

(userDetails: UserDetails | undefined) => void
required
callback function that is called when the fetching process is successful. It receives the UserDetails object as an argument.
UserDetails type
HttpErrorCallback
required
callback function that is called when an error occurs during the sign-up process.
HttpErrorCallback type

Returns

userDetails
user details object if the fetching process is successful.
boolean
boolean indicating whether the fetching process is currently in progress.
boolean
boolean indicating whether an error occurred during the fetching process.
HttpError | Error
error object if an error occurred during the fetching process.