Skip to content

Commit 457401b

Browse files
authored
rm deprecated componentWillReceiveProps
1 parent 905e754 commit 457401b

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

source/index.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,19 @@ class Popover extends React.Component {
9696
this.targetEl = ReactDOM.findDOMNode(this)
9797
if (this.props.isOpen) this.enter()
9898
}
99-
componentWillReceiveProps(propsNext) {
100-
//log(`Component received props!`, propsNext)
101-
const willOpen = !this.props.isOpen && propsNext.isOpen
102-
const willClose = this.props.isOpen && !propsNext.isOpen
103-
104-
if (willOpen) this.open()
105-
else if (willClose) this.close()
106-
}
10799
componentDidUpdate(propsPrev, statePrev) {
108100
//log(`Component did update!`)
109101
const didOpen = !statePrev.toggle && this.state.toggle
110102
const didClose = statePrev.toggle && !this.state.toggle
111103

112-
if (didOpen) this.enter()
113-
else if (didClose) this.exit()
104+
if (didOpen) {
105+
this.open() // todo: remove
106+
this.enter()
107+
}
108+
else if (didClose) {
109+
this.close() // todo: remove
110+
this.exit()
111+
}
114112
}
115113
componentWillUnmount() {
116114
/* If the Popover is unmounted while animating,

0 commit comments

Comments
 (0)