ant-design / ant-design-mobile-rn

Ant Design for React Native
https://rn.mobile.ant.design/
MIT License
3.04k stars 612 forks source link

Warning: Portal组件 EventEmitter.removeListener方法已被弃用 #1200

Closed SoonIter closed 1 year ago

SoonIter commented 2 years ago

What problem does this feature solve?

这个方法将被废弃,总是报警告,希望修改一下 Console Warning EventEmitter.removeListener(' ANT DESIGN MOBILE RN REMOVE_ PORTAL', Method has been deprecated.Please instead use remove() on the subscription returned by EventEmitter.addListener'.

What does the proposed API look like?

{ key: "componentWillUnmount", value: function componentWillUnmount() { this._mountSubscription.remove(); this._unmountSubscription.remove(); // TopViewEventEmitter.removeListener(addType, this._mount); // TopViewEventEmitter.removeListener(removeType, this._unmount); }, },

809388027 commented 1 year ago

I also encountered the same problem, and now the prompt is obsolete