Skip to content
New issue

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

【重要】resize-event.js removeResizeListener undefined报错 #833

Open
zjy01 opened this issue Aug 2, 2018 · 4 comments
Open

【重要】resize-event.js removeResizeListener undefined报错 #833

zjy01 opened this issue Aug 2, 2018 · 4 comments

Comments

@zjy01
Copy link

zjy01 commented Aug 2, 2018

Description

在Select 组件上经常发生报错,会导致页面崩溃

Reproduce Steps

不太确认复现步骤,应该是Select组件快速 mountunmount,结果element.__resizeListeners__.splice里的__resizeListeners__是undefined

Error Trace (if possible)

clientMiddleware.js:43 [clientMiddleware] error catched!  error:  TypeError: Cannot read property 'splice' of undefined
    at removeResizeListener (resize-event.js:185)
    at ProxyComponent.componentWillUnmount (Select.js:190)
    at ProxyComponent.proxiedComponentWillUnmount (createPrototypeProxy.js:81)

It's better to post up the error stack for us to trace this issue.

Solution

What needs to be done to address this issue? Ideally, provide a pull request with a fix.

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

@fhvknb
Copy link

fhvknb commented Aug 17, 2018

Me too

@fhvknb
Copy link

fhvknb commented Aug 17, 2018

It must happend when i reload page where Select component .

@reeem
Copy link

reeem commented Aug 29, 2018

Me too

This issue is reproduced when the selection component is not exposed or displayed by asynchronous data props, when determined by the rendering method, and when there is a selection component previously.

Perhaps the error occurs because removeResizeListener is fired after the previously mounted component has been unmounted and there is no element .__ resizeListeners__ at this time.

In my case, instead of determining whether to expose a select component in render, I changed it to setting the state value in componentWillReceiveProps, and the issue was no longer reproduced.

@mytharcher
Copy link
Contributor

Duplicated as in #814 and fixed by PR #831 (merged).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants