Closed fritx closed 8 years ago
I got the problem and try to fixed it in version 0.0.16.
Even the element has been removed, onload/onerror
would still be triggered. react-lite will removeEvent all the event handler in its props at v0.0.16.
please update react-lite
, and try again.
sorry about misunderstand your description.
I had try many time about onload/onerror
, and can't reappear this.refs == null
.
I wonder which browser did you use. (since I tryed it at chrome), maybe other browser's onload/onerror
event would be triggered, even the element did'nt insert to document but already in memory.
You can add debugger
when onload
event is calling, and check whether the img elment was inserted to document or not.
But it seems that the problem was gone after upgrading react-lite last week.
OK:-)
Now which version of react-lite are you using?
Hey @Lucifier129 In react-lite, I found that
this.refs
sometimes equals to null, called inonLoad/onError
of<img>
tag. The probability is very small, but I can always reproduce it by very frequent rendering. It causes a bug in my app. And when I try the regular React, it's fine.