leefsmp / Re-Flex

Resizable Flex layout container components for advanced React web applications
https://leefsmp.github.io/Re-Flex/index.html
MIT License
639 stars 72 forks source link

TypeError: can't access property "ref", element is undefined (in ReflexContainer.getSize) #126

Closed vocko closed 3 years ago

vocko commented 3 years ago

I'm getting quite a lot of these, it seems it should be quite easy to prevent it by null checking the ref property.

TypeError: can't access property "ref", element is undefined
    getSize ReflexContainer.js:249
    computeAvailableShrink ReflexContainer.js:401
    computeAvailableOffset ReflexContainer.js:341
    ReflexContainer ReflexContainer.js:109
    ReflexContainer ReflexContainer.js:102
    emit ReflexEvents.js:63
    componentDidUpdate ReflexElement.js:137

PS: I did not forget about the other ticket just get side-tracked by other things but hopefully will be able to put the codesandbox example together soon.

leefsmp commented 3 years ago

this error reflects an incorrect use of the lib, check issue #101 and #98

vocko commented 3 years ago

Ah, ok, thanks. This would deserve a bit more descriptive explanation, because it is not very obvious from the documentation. However, I've added the direction property and so far it seems the error is gone. Thank you.