Skip to content

Commit

Permalink
IosCompliantAppleAuthButton types: Limit what can get passed for `sty…
Browse files Browse the repository at this point in the history
…le`.

Partly in the spirit of 8b30fa9, but also because this helps us
avoid lots of mystifying error reports from Flow when we take the
upgrade to Flow v0.122.0, with the React Native v0.63 upgrade
(zulip#4245).

See discussion of those errors [1], and Greg's conclusion that Flow
might have been a bit more helpful than it was here. Ah, well.

[1] https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/Flow.20errors.20in.20.23M4318/near/1075420
  • Loading branch information
chrisbobbe committed Dec 4, 2020
1 parent 659d174 commit f22a654
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/start/IosCompliantAppleAuthButton/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* @flow strict-local */
import React, { PureComponent } from 'react';
import { View } from 'react-native';
import type { ViewStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet';
import type { ViewStyle } from 'react-native/Libraries/StyleSheet/StyleSheet';
import * as AppleAuthentication from 'expo-apple-authentication';
import { connect } from '../../react-redux';

import type { SubsetProperties } from '../../generics';
import Custom from './Custom';
import type { ThemeName } from '../../reduxTypes';
import type { Dispatch } from '../../types';
Expand All @@ -15,7 +16,15 @@ type SelectorProps = $ReadOnly<{|
|}>;

type Props = $ReadOnly<{|
style?: ViewStyleProp,
// See `ZulipButton`'s `style` prop, where a comment discusses this
// idea.
/* eslint-disable flowtype/generic-spacing */
style?: SubsetProperties<
ViewStyle,
{|
marginTop?: mixed,
|},
>,
onPress: () => void | Promise<void>,

dispatch: Dispatch,
Expand Down

0 comments on commit f22a654

Please sign in to comment.