Library Definition Implicitly Getting "null | void" Added to Type
My Flow Version: 0.47.0
I am trying to create a Library Definition for the 'react-native-status-bar-size' library to use in my project:
https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVATApgYxgQwCcswBbODAVxhIHJj8cAXAWgDt8mBLANyxYDOTTpQEsARkUFcAXllpgA3qjBhseIiXJUaAOiwAPAA5xCTAQC4lK1WByVCxNkwASWLgHMAFkyttKpOJYhDYAvqjhqFykJmZgAMrCTKIAQkTxslgAkgDy8WBQhHCkYPRYjKwc3HyCSaISUgKZtADc6FBwcAAUiSICaYQZcrnxuvaOWM5unj4AlG2oUJRszFxwbAWdXQZ+AUGEs7uBwda2xMmEGwZt4UA
In the Try Flow sandbox, it is working perfectly, but I am getting an error in my project. By putting that exact declare module block in my flow-typed folder, it is being treated as if I did currentHeight: number | null | void.
The following 2 errors print out:
23: this.state = {
24: currentStatusBarHeight: StatusBarSizeIOS.currentHeight
25: };
^ object literal. This type is incompatible with
23: this.state = {
^^^^^^^^^^ object type
Property `currentStatusBarHeight` is incompatible:
24: currentStatusBarHeight: StatusBarSizeIOS.currentHeight
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ null. This type is incompatible with
14: currentStatusBarHeight: number
^^^^^^ number
23: this.state = {
24: currentStatusBarHeight: StatusBarSizeIOS.currentHeight
25: };
^ object literal. This type is incompatible with
23: this.state = {
^^^^^^^^^^ object type
Property `currentStatusBarHeight` is incompatible:
24: currentStatusBarHeight: StatusBarSizeIOS.currentHeight
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ undefined. This type is incompatible with
14: currentStatusBarHeight: number
^^^^^^ number
This was likely fixed a while ago.