Open tannerlinsley opened 6 years ago
We came across the same issue. It would appear this is due to the fact that, as of ES2015 - a function within a conditional if
block, is scoped to that block - and thus not available outside. Given that I'm using this in a require
, the solution I've taken here is to use my own copy of the detect-element-resize
file - with the if (!attachEvent) {
conditional commented out.
Same issue here =/
@mrjamesriley's fix is working. Thanks
Using in create-react-app as a fresh install on the latest versions of everything, I'm getting this error. Not sure why it's happening, since the function is actually getting registered. Maybe it's not getting hoisted correctly?
The call is being made from here: https://github.com/sdecima/javascript-detect-element-resize/blob/master/detect-element-resize.js#L124