Skip to content

Commit cd0f80c

Browse files
committed
docs: Rename usetoast hook
1 parent 31e0ee0 commit cd0f80c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

docs/api/hooks.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Below is a list of available hooks along with a brief description for each of th
9393
| useSettings | Accesses and modifies chatbot settings. |
9494
| useStyles | Accesses and modifies chatbot styles. |
9595
| useTextArea | Manages the text input area of the chatbot, including setting and clearing values. |
96-
| useToast | Manages toasts shown within the chatbot, such as showing or missing them. |
96+
| useToasts | Manages toasts shown within the chatbot, such as showing or missing them. |
9797
| useVoice | Manages voice functionality, such as toggling voice on or off |
9898

9999
## Hook Details
@@ -421,10 +421,10 @@ const MyNestedComponent = () => {
421421
};
422422
```
423423
424-
### useToast
424+
### useToasts
425425
426426
#### Description
427-
The `useToast` hook allows you to track and manage the chatbot's toasts.
427+
The `useToasts` hook allows you to track and manage the chatbot's toasts.
428428
429429
#### Return Values
430430
| Name | Type | Description |

docs/concepts/conversations.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Toasts are strictly speaking not essential for chatbot conversations. However, t
186186

187187
:::info Info
188188

189-
For manipulating toasts, it is recommended that you utilize `showToast` and `dismissToast` which are provided in [**params**](/docs/api/params#showtoast) or [**hooks**](/docs/api/hooks#useToast). If you are directly manipulating the `toasts` array (not recommended), which is possible via the [`useToast`](/docs/api/hooks#usetoast) hook, you need to specify **at least the 2 required fields** yourself.
189+
For manipulating toasts, it is recommended that you utilize `showToast` and `dismissToast` which are provided in [**params**](/docs/api/params#showtoast) or [**hooks**](/docs/api/hooks#useToasts). If you are directly manipulating the `toasts` array (not recommended), which is possible via the [`useToasts`](/docs/api/hooks#usetoast) hook, you need to specify **at least the 2 required fields** yourself.
190190

191191
:::
192192

docs/examples/custom_hooks.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ keywords: [react, chat, chatbot, chatbotify]
77

88
# Custom Hooks
99

10-
The following is an example for using custom hooks, which allows you to interact with the chatbot functionalities **externally** (i.e. from your own components). The full list of hooks and the functionalities they expose can be found [**here**](/docs/api/hooks). For this example, we'll only be looking at a few hooks such as [**`useAudio`**](/docs/api/hooks#useaudio), [**`useFlow`**](/docs/api/hooks#useflow), [**`useToast`**](/docs/api/hooks#usetoast) and [**`useNotifications`**](/docs/api/hooks#usenotifications). The hooks are imported within the `MyChatBotWrapper` component which is nested under `ChatBotProvider`.
10+
The following is an example for using custom hooks, which allows you to interact with the chatbot functionalities **externally** (i.e. from your own components). The full list of hooks and the functionalities they expose can be found [**here**](/docs/api/hooks). For this example, we'll only be looking at a few hooks such as [**`useAudio`**](/docs/api/hooks#useaudio), [**`useFlow`**](/docs/api/hooks#useflow), [**`useToasts`**](/docs/api/hooks#usetoast) and [**`useNotifications`**](/docs/api/hooks#usenotifications). The hooks are imported within the `MyChatBotWrapper` component which is nested under `ChatBotProvider`.
1111

1212
```jsx live noInline title=MyChatBot.js
1313
const MyChatBotWrapper = () => {
1414
const { toggleAudio } = useAudio();
1515
const { restartFlow } = useFlow();
16-
const { showToast } = useToast();
16+
const { showToast } = useToasts();
1717
const { playNotificationSound } = useNotifications();
1818

1919
const settings = {

0 commit comments

Comments
 (0)