Skip to content

Commit

Permalink
style: Add fixmes for a few issues the RN/Flow upgrade turns up.
Browse files Browse the repository at this point in the history
Without this change, after the upcoming upgrades Flow gives error
messages here.  If I understand the error messages correctly (though
I'm not confident I do), the point is that these particular components
insist on their props being read-only -- and while ViewStyleProp and
friends make that guarantee, DangerouslyImpreciseStyleProp doesn't.

These will be resolved properly when we eventually go about and narrow
down uses of DangerouslyImpreciseStyleProp to the more specific types.
Until then, just leave these fixmes.
  • Loading branch information
gnprice committed Oct 31, 2018
1 parent 1712f10 commit cc64ebe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common/KeyboardAvoider.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class KeyboardAvoider extends PureComponent<Props> {

return (
<KeyboardAvoidingView
behavior={behavior}
behavior={behavior /* v--- $FlowFixMe wants ViewStyleProp */}
contentContainerStyle={contentContainerStyle}
style={style}
>
Expand Down
5 changes: 4 additions & 1 deletion src/common/Screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ class Screen extends PureComponent<Props> {
>
{scrollableContent ? (
<ScrollView
contentContainerStyle={[centerContent && componentStyles.content, style]}
contentContainerStyle={
/* $FlowFixMe wants ViewStyleProp */
[centerContent && componentStyles.content, style]
}
style={componentStyles.childrenWrapper}
keyboardShouldPersistTaps={keyboardShouldPersistTaps}
>
Expand Down
2 changes: 1 addition & 1 deletion src/common/Touchable.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class Touchable extends PureComponent<Props> {
return (
<TouchableHighlight
accessibilityLabel={accessibilityLabel}
underlayColor={HIGHLIGHT_COLOR}
underlayColor={HIGHLIGHT_COLOR /* v--- $FlowFixMe wants ViewStyleProp */}
style={style}
onPress={onPress}
onLongPress={onLongPress}
Expand Down

0 comments on commit cc64ebe

Please sign in to comment.