Closed idibidiart closed 6 years ago
@idibidiart
There is a project to render RN in the browser (react-native-web). The container in that case could be 0 size for various reasons. Sometimes web developers use that to hide components, or during resizing it could momentarily go to 0. An easy guard for the initialization case is to init _screenWidth & _screenHeight to -1 instead of 0. Dimensions should never return negative values.
Yes Ir simply initialize to undefined since they will be calculated anyway and cached. Will do.
set all initial values to null, in case Width and Height come back as 0 or undefined
pushed and published
@peacechen please see comments on PR #26 and review this