发起:
DeviceEventEmitter.emit('login')
调用:
componentDidMount() {
this.addMallToken = DeviceEventEmitter.addListener('login', e => {
this._alertOrNot()
})
}
一定要销毁:
componentWillUnmount() {
this.addMallToken.remove()
}
发起:
DeviceEventEmitter.emit('login')
调用:
componentDidMount() {
this.addMallToken = DeviceEventEmitter.addListener('login', e => {
this._alertOrNot()
})
}
一定要销毁:
componentWillUnmount() {
this.addMallToken.remove()
}
本文标题:react-native 发起监听
本文链接:https://www.haomeiwen.com/subject/qcobgqtx.html
网友评论