Skip to main content

useCreateReport

Overview

The useCreateReport hook allows users to report inappropriate or problematic content. It requires a type parameter to specify whether you’re reporting comments or entities, and returns a specialized function for that type.

Usage Example

Parameters & Returns

Hook Parameters

The hook accepts an object with the following field:

Returns

The hook returns a single function based on the type specified:
  • For type: "comment": Returns createCommentReport function
  • For type: "entity": Returns createEntityReport function

Function Parameters

Both returned functions accept the same parameters:
targetId
string
Yes
reason
ReportReasonKey
Yes
details
string
No