File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -84,24 +84,19 @@ The modal Component will receive the sent `props` and will also have `isOpen` an
84
84
import React from ' react' ;
85
85
import Modal from ' react-modal' ;
86
86
87
- export class MyModal extends React . Component {
87
+ export const MyModal = ({title, isOpen, onClose}) => {
88
88
89
- close () {
89
+ const close = () => {
90
90
// `onClose` will close the modal and will call the callback defined in main.jsx
91
- this . props . onClose (' param' , ' param2' , ' param3' );
91
+ onClose (' param' , ' param2' , ' param3' );
92
92
}
93
93
94
- render () {
95
- // `isOpen` is managed only by 'PopupManager'
96
- const { isOpen } = this .props ;
97
-
98
- return (
94
+ return (
99
95
< Modal isOpen= {isOpen} >
100
- < span> {this . props . title }< / span>
101
- < button onClick= {() => this . close () }> close < / button>
96
+ < span> {title}< / span>
97
+ < button onClick= {close}> close < / button>
102
98
< / Modal>
103
- );
104
- }
99
+ );
105
100
}
106
101
```
107
102
You can’t perform that action at this time.
0 commit comments