You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -172,12 +172,24 @@ For manipulating messages, it is recommended that you utilize `injectMessage` an
172
172
173
173
## Toast
174
174
175
-
Toasts are strictly speaking not essential for chatbot conversations. However, they are oftentime useful in providing feedback to users. For example, the [**rcb-input-validator-plugin**] uses toasts to inform users of any input validation errors. A toast comprises of **3 properties**:
Toasts are strictly speaking not essential for chatbot conversations. However, they are oftentime useful in providing feedback to users (as **outlined in red** on the image above). For example, the [**rcb-input-validator-plugin**](https://github.com/react-chatbotify-plugins/rcb-input-validator-plugin) uses toasts to inform users of any input validation errors. A toast comprises of **3 properties**:
176
182
177
183
- id (required) - an auto-generated uuidv4 `string`, uniquely identifying a toast
178
184
- content (required) - a `string` or `JSX.Element`, representing the content of the toast
179
185
- timeout (optional) - specifies the duration that the toast is shown for before it is automatically dismissed
180
186
187
+
:::info Info
188
+
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.
190
+
191
+
:::
192
+
181
193
## Summary
182
194
183
195
Does that sound like a lot to take in? Fret not! Let us take one final look at the code snippet we saw at the beginning and put things all together. Notice that the `ChatBot` takes in the `flow` that we have just gone through above. Tinker with the live editor below and try out the result for yourself!
0 commit comments