File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
static/usage/v8/modal/controller Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -14,24 +14,20 @@ import {
1414} from ' @ionic/react' ;
1515import { OverlayEventDetail } from ' @ionic/core/components' ;
1616
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 }) => {
2218 const inputRef = useRef <HTMLIonInputElement >(null );
2319 return (
2420 <IonPage >
2521 <IonHeader >
2622 <IonToolbar >
2723 <IonButtons slot = " start" >
28- <IonButton color = " medium" onClick = { () => onDismiss (null , ' cancel' )} >
24+ <IonButton color = " medium" onClick = { () => dismiss (null , ' cancel' )} >
2925 Cancel
3026 </IonButton >
3127 </IonButtons >
3228 <IonTitle >Welcome</IonTitle >
3329 <IonButtons slot = " end" >
34- <IonButton onClick = { () => onDismiss (inputRef .current ?.value , ' confirm' )} strong = { true } >
30+ <IonButton onClick = { () => dismiss (inputRef .current ?.value , ' confirm' )} strong = { true } >
3531 Confirm
3632 </IonButton >
3733 </IonButtons >
@@ -48,7 +44,7 @@ const ModalExample = ({
4844
4945function Example() {
5046 const [present, dismiss] = useIonModal (ModalExample , {
51- onDismiss : (data : string , role : string ) => dismiss (data , role ),
47+ dismiss : (data : string , role : string ) => dismiss (data , role ),
5248 });
5349 const [message, setMessage] = useState (' This modal example uses the modalController to present and dismiss modals.' );
5450
You can’t perform that action at this time.
0 commit comments