useRespondToReactionResponse
React hook used to interact with a Trixta reaction that does require a response for a given roleName. Will trigger the callBack when a reaction is received.
import { useRespondToReactionResponse } from '@trixtateam/trixta-js-core';
const {
hasRoleAccess,
latestInstance,
respondToReaction
} = useRespondToReactionResponse<TInitialData>({
roleName:"",
reactionName:"",
debugMode: false,
});Options
roleName : stringRequired
Trixta role name
reactionName : stringRequired
Trixta reaction name
debugMode: booleanOptional
Defaults to false.
If set to
true, enables Trixta console debugging
Returns
hasRoleAccess : booleanWill be
trueif theroleNamehas access for this user.
latestInstance :TrixtaReactionInstanceFirst or most recent Trixta instance
respondToReaction : (parameters: { data, instance, responseEvent, errorEvent }) => voidRequired
This function will respond to the reaction with the data for the given parameters that is received from Trixta.
Last updated
Was this helpful?