In-App UI
React
Hooks
useGuide
useGuide
The useGuide
hook is used to retrieve guides by either a message type key or a specific guide key. It supports typing the guide step content to ensure type safety.
Parameters#
Accepts an object (KnockGuideFilterParams
) with the following properties:
keystring
Match a specific guide by its keytypestring
Match any guide by its type (message type)Returns#
A UseGuideReturn
object with the following properties:
guideKnockGuide | undefined
The matching guidestepKnockGuideStep | undefined
The matching guide step. Will always be defined if the guide is defined.Example#
Specific message type#
The following example demonstrates how to use the useGuide
hook to get the guide for a specific message type.
Typing the guide and step#
The useGuide
hook returns the guide and step as KnockGuide
and KnockGuideStep
respectively.