Skip to main content

useReviewSummary

sample usage:

  const {
average_rating,
total_questions,
total_reviews,
ratings,
productId,
openAddReview,
isLoading,
} = useReviewSummary(props);

Hook return data

NameDescription
average_ratingAverage Review with 1 decimal point
total_reviewsTotal number of reviews
productIdCurrent product ID
ratingsArray of object with ratings data, sample: [{ rating, percentage, count}]
total_questionsTotal number of questions
onShowFullReviewFunction to Open review list
openAddReviewFunction to Open add review page
isLoadingBoolean value to show loading while data is being retrieved