We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.没必要使用DeviceEventEmitter,会造成性能的极大损耗 没理解错的话,您的RRCTopView是单例的,RRCTopView中定义一个INSTANCE export default class RRCTopView extends Component { static INSTANCE = false;
constructor(props) { .... RRCTopView.INSTANCE = this; }
static addAlert(element) { let key = ++keyValue; //这里不再通过DeviceEventEmitter.emit触发 RRCTopView.INSTANCE.addAlertToTopView({ key, element }); return key; } }
2.这样就可以去除componentWillMount和componentWillUnmount 就能兼容新版本的react native的 componentWillMount改名的尴尬了
The text was updated successfully, but these errors were encountered:
No branches or pull requests
1.没必要使用DeviceEventEmitter,会造成性能的极大损耗
没理解错的话,您的RRCTopView是单例的,RRCTopView中定义一个INSTANCE
export default class RRCTopView extends Component {
static INSTANCE = false;
constructor(props) {
....
RRCTopView.INSTANCE = this;
}
static addAlert(element) {
let key = ++keyValue;
//这里不再通过DeviceEventEmitter.emit触发
RRCTopView.INSTANCE.addAlertToTopView({ key, element });
return key;
}
}
2.这样就可以去除componentWillMount和componentWillUnmount
就能兼容新版本的react native的 componentWillMount改名的尴尬了
The text was updated successfully, but these errors were encountered: