Skip to content

Commit c2342db

Browse files
committed
fixed function not being declared using useToast's hook
1 parent 850ce38 commit c2342db

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

docs/addToast.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ The available options are:
1919
For example, displaying a success toast would be:
2020

2121
```jsx
22-
import { addToast } from 'react-native-rooster';
22+
import { useToast } from 'react-native-rooster';
23+
24+
const { addToast } = useToast();
2325

2426
addToast({
2527
type: 'success',

docs/removeToast.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ sidebar_label: removeToast
77
All toasts are automatically removed after 1.5s. However, you can manually pop the last toast from screen doing:
88

99
```jsx
10-
import { removeToast } from 'react-native-rooster';
10+
import { useToast } from 'react-native-rooster';
11+
12+
const { removeToast } = useToast();
1113

1214
removeToast();
1315
```

docs/setToastConfig.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ The default colors are:
2424
An example changing the default success' bgColor to olive:
2525

2626
```jsx
27-
import { setToastConfig } from 'react-native-rooster';
27+
import { useToast } from 'react-native-rooster';
28+
29+
const { setToastConfig } = useToast();
2830

2931
setToastConfig({
3032
bgColor: {
@@ -47,7 +49,9 @@ You can change the custom fontFamily for the texts.
4749
An example changing `fontFamilyBold` to `Montserrat` family:
4850

4951
```jsx
50-
import { setToastConfig } from 'react-native-rooster';
52+
import { useToast } from 'react-native-rooster';
53+
54+
const { setToastConfig } = useToast();
5155

5256
setToastConfig({
5357
font: {
@@ -67,7 +71,9 @@ You can change the default toast's time to dismiss.
6771
To change this to 4000ms you can just do:
6872

6973
```jsx
70-
import { setToastConfig } from 'react-native-rooster';
74+
import { useToast } from 'react-native-rooster';
75+
76+
const { setToastConfig } = useToast();
7177

7278
setToastConfig({
7379
timeToDismiss: 4000

0 commit comments

Comments
 (0)