File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed
Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ The available options are:
1919For 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
2426addToast ({
2527 type: ' success' ,
Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ sidebar_label: removeToast
77All 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
1214removeToast ();
1315```
Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ The default colors are:
2424An 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
2931setToastConfig ({
3032 bgColor: {
@@ -47,7 +49,9 @@ You can change the custom fontFamily for the texts.
4749An 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
5256setToastConfig ({
5357 font: {
@@ -67,7 +71,9 @@ You can change the default toast's time to dismiss.
6771To 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
7278setToastConfig ({
7379 timeToDismiss: 4000
You can’t perform that action at this time.
0 commit comments