Skip to content

Commit ad0e0fd

Browse files
committed
Update declarative example
1 parent 162e8a4 commit ad0e0fd

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

example/src/Declarative.jsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import { Modal, Button } from 'antd';
2-
import NiceModal, { useModal, ModalDef } from '@ebay/nice-modal-react';
2+
import NiceModal, { useModal } from '@ebay/nice-modal-react';
33

44
export const MyAntdModal = NiceModal.create(({ name }) => {
55
const modal = useModal();
66
return (
7-
<Modal title="Hello Antd" visible={modal.visible} onOk={modal.hide} onCancel={modal.hide} afterClose={modal.remove}>
7+
<Modal
8+
title="Hello Antd"
9+
visible={modal.visible}
10+
onOk={modal.hide}
11+
onCancel={modal.hide}
12+
afterClose={modal.remove}
13+
>
814
Greetings: {name}!
915
</Modal>
1016
);
@@ -16,7 +22,7 @@ export default function AntdSample() {
1622
<Button type="primary" onClick={() => NiceModal.show('my-antd-modal', { name: 'Nate' })}>
1723
Show Modal
1824
</Button>
19-
<ModalDef id="my-antd-modal" component={MyAntdModal} />
25+
<MyAntdModal id="my-antd-modal" />
2026
</>
2127
);
2228
}

0 commit comments

Comments
 (0)