File tree 1 file changed +4
-8
lines changed
static/usage/v8/modal/controller
1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -14,24 +14,20 @@ import {
14
14
} from ' @ionic/react' ;
15
15
import { OverlayEventDetail } from ' @ionic/core/components' ;
16
16
17
- const ModalExample = ({
18
- onDismiss ,
19
- }: {
20
- onDismiss: (data ? : string | null | undefined | number , role ? : string ) => void ;
21
- }) => {
17
+ const ModalExample = ({ dismiss }: { dismiss: (data ? : string | null | undefined | number , role ? : string ) => void }) => {
22
18
const inputRef = useRef <HTMLIonInputElement >(null );
23
19
return (
24
20
<IonPage >
25
21
<IonHeader >
26
22
<IonToolbar >
27
23
<IonButtons slot = " start" >
28
- <IonButton color = " medium" onClick = { () => onDismiss (null , ' cancel' )} >
24
+ <IonButton color = " medium" onClick = { () => dismiss (null , ' cancel' )} >
29
25
Cancel
30
26
</IonButton >
31
27
</IonButtons >
32
28
<IonTitle >Welcome</IonTitle >
33
29
<IonButtons slot = " end" >
34
- <IonButton onClick = { () => onDismiss (inputRef .current ?.value , ' confirm' )} strong = { true } >
30
+ <IonButton onClick = { () => dismiss (inputRef .current ?.value , ' confirm' )} strong = { true } >
35
31
Confirm
36
32
</IonButton >
37
33
</IonButtons >
@@ -48,7 +44,7 @@ const ModalExample = ({
48
44
49
45
function Example() {
50
46
const [present, dismiss] = useIonModal (ModalExample , {
51
- onDismiss : (data : string , role : string ) => dismiss (data , role ),
47
+ dismiss : (data : string , role : string ) => dismiss (data , role ),
52
48
});
53
49
const [message, setMessage] = useState (' This modal example uses the modalController to present and dismiss modals.' );
54
50
You can’t perform that action at this time.
0 commit comments