Skip to content

Commit 81e57bf

Browse files
committed
Remove useless componentWillReceiveProps
1 parent b74b31e commit 81e57bf

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/index.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export default class extends Component {
66
constructor(props) {
77
super(props);
88

9-
109
if (props.source.method === 'POST') {
1110
const contentType = props.source.headers['Content-Type'];
1211
let body = '';
@@ -33,18 +32,6 @@ export default class extends Component {
3332
}
3433
}
3534

36-
componentWillReceiveProps(nextProps) {
37-
const {onMessage} = nextProps
38-
39-
if(this.props.onMessage && onMessage) return
40-
41-
componentWillUnmount()
42-
43-
if (onMessage) {
44-
window.addEventListener('message', this.onMessage, true);
45-
}
46-
}
47-
4835
componentWillUnmount() {
4936
if (this.props.onMessage) {
5037
window.removeEventListener('message', this.onMessage, true);

0 commit comments

Comments
 (0)