Skip to content

Commit 125d53e

Browse files
chore: use constructor instead of deprecated componentWillMount (#40)
1 parent 26f7aa8 commit 125d53e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/portal.jsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ class Portal extends Component {
88
appendTo: document.body,
99
}
1010

11-
componentWillMount () {
12-
const appendTo = this.props.appendTo
11+
constructor (props) {
12+
super(props)
13+
14+
const appendTo = props.appendTo
1315
const id = `portal-${Portal.idNum++}`
1416
let element = appendTo.ownerDocument.getElementById(id)
1517

0 commit comments

Comments
 (0)