diff --git a/src/account-info/AccountDetails.js b/src/account-info/AccountDetails.js index effec9a796b..cdb61a7ad4a 100644 --- a/src/account-info/AccountDetails.js +++ b/src/account-info/AccountDetails.js @@ -1,5 +1,6 @@ /* @flow strict-local */ import React from 'react'; +import type { Node } from 'react'; import { View } from 'react-native'; import type { UserOrBot } from '../types'; @@ -33,7 +34,7 @@ type Props = $ReadOnly<{| user: UserOrBot, |}>; -export default function AccountDetails(props: Props) { +export default function AccountDetails(props: Props): Node { const { user } = props; const ownUser = useSelector(getOwnUser); diff --git a/src/account-info/AccountDetailsScreen.js b/src/account-info/AccountDetailsScreen.js index 39278ff8abd..9a02cf37f36 100644 --- a/src/account-info/AccountDetailsScreen.js +++ b/src/account-info/AccountDetailsScreen.js @@ -1,5 +1,6 @@ /* @flow strict-local */ import React, { useCallback } from 'react'; +import type { Node } from 'react'; import type { RouteProp } from '../react-navigation'; import type { AppNavigationProp } from '../nav/AppNavigator'; @@ -30,7 +31,7 @@ type Props = $ReadOnly<{| route: RouteProp<'account-details', {| userId: UserId |}>, |}>; -export default function AccountDetailsScreen(props: Props) { +export default function AccountDetailsScreen(props: Props): Node { const dispatch = useDispatch(); const user = useSelector(state => getUserForId(state, props.route.params.userId)); const isActive = useSelector(state => getUserIsActive(state, props.route.params.userId)); diff --git a/src/common/ZulipStatusBar.js b/src/common/ZulipStatusBar.js index ce9473fb5e2..b740ea819e1 100644 --- a/src/common/ZulipStatusBar.js +++ b/src/common/ZulipStatusBar.js @@ -1,6 +1,7 @@ /* @flow strict-local */ import React from 'react'; +import type { Node } from 'react'; import { Platform, StatusBar } from 'react-native'; // $FlowFixMe[untyped-import] import Color from 'color'; @@ -42,7 +43,7 @@ type Props = $ReadOnly<{| * top inset grows to accommodate a visible status bar, and shrinks to * give more room to the app's content when the status bar is hidden. */ -export default function ZulipStatusBar(props: Props) { +export default function ZulipStatusBar(props: Props): Node { const { hidden = false } = props; const theme = useSelector(state => getSettings(state).theme); const orientation = useSelector(state => getSession(state).orientation); diff --git a/src/emoji/Emoji.js b/src/emoji/Emoji.js index be1e06e7593..c35fd2ac948 100644 --- a/src/emoji/Emoji.js +++ b/src/emoji/Emoji.js @@ -1,5 +1,6 @@ /* @flow strict-local */ import React from 'react'; +import type { Node } from 'react'; import { Image } from 'react-native'; import { createIconSet } from 'react-native-vector-icons'; @@ -23,7 +24,7 @@ const componentStyles = createStyleSheet({ image: { width: 20, height: 20 }, }); -export default function Emoji(props: Props) { +export default function Emoji(props: Props): Node { const { code } = props; const imageEmoji = useSelector(state => props.type === 'image' ? getAllImageEmojiByCode(state)[props.code] : undefined, diff --git a/src/emoji/EmojiPickerScreen.js b/src/emoji/EmojiPickerScreen.js index 97fba69491d..62b844701dd 100644 --- a/src/emoji/EmojiPickerScreen.js +++ b/src/emoji/EmojiPickerScreen.js @@ -1,6 +1,7 @@ /* @flow strict-local */ import React, { useState, useCallback } from 'react'; +import type { Node } from 'react'; import { FlatList } from 'react-native'; import type { RouteProp } from '../react-navigation'; @@ -24,7 +25,7 @@ type Props = $ReadOnly<{| route: RouteProp<'emoji-picker', {| messageId: number |}>, |}>; -export default function EmojiPickerScreen(props: Props) { +export default function EmojiPickerScreen(props: Props): Node { const { route } = props; const { messageId } = route.params; diff --git a/src/message/MentionedUserNotSubscribed.js b/src/message/MentionedUserNotSubscribed.js index 9f8d8be4d0f..7c0140d4ef9 100644 --- a/src/message/MentionedUserNotSubscribed.js +++ b/src/message/MentionedUserNotSubscribed.js @@ -1,6 +1,7 @@ /* @flow strict-local */ import React, { useCallback } from 'react'; +import type { Node } from 'react'; import { View, TouchableOpacity } from 'react-native'; import type { Stream, UserOrBot, Subscription } from '../types'; @@ -49,7 +50,7 @@ const styles = createStyleSheet({ }, }); -export default function MentionedUserNotSubscribed(props: Props) { +export default function MentionedUserNotSubscribed(props: Props): Node { const { user, stream, onDismiss } = props; const auth = useSelector(getAuth); diff --git a/src/message/NotSubscribed.js b/src/message/NotSubscribed.js index ff0fe479131..d88474ab215 100644 --- a/src/message/NotSubscribed.js +++ b/src/message/NotSubscribed.js @@ -1,6 +1,7 @@ /* @flow strict-local */ import React, { useCallback } from 'react'; +import type { Node } from 'react'; import { View } from 'react-native'; import type { Stream, Narrow } from '../types'; @@ -14,7 +15,7 @@ type Props = $ReadOnly<{| narrow: Narrow, |}>; -export default function NotSubscribed(props: Props) { +export default function NotSubscribed(props: Props): Node { const auth = useSelector(getAuth); const stream: $ReadOnly<{ ...Stream, ... }> = useSelector(state => getStreamInNarrow(state, props.narrow), diff --git a/src/nav/ZulipNavigationContainer.js b/src/nav/ZulipNavigationContainer.js index 27bb912e18f..14581b43caa 100644 --- a/src/nav/ZulipNavigationContainer.js +++ b/src/nav/ZulipNavigationContainer.js @@ -1,5 +1,6 @@ /* @flow strict-local */ import React, { useContext, useEffect } from 'react'; +import type { Node } from 'react'; import { NavigationContainer, DefaultTheme, DarkTheme } from '@react-navigation/native'; import { useSelector } from '../react-redux'; @@ -20,7 +21,7 @@ type Props = $ReadOnly<{||}>; * - Call `createAppContainer` with the appropriate `initialRouteName` * and `initialRouteParams` which we get from data in Redux. */ -export default function ZulipAppContainer(props: Props) { +export default function ZulipAppContainer(props: Props): Node { const themeName = useSelector(state => getSettings(state).theme); useEffect( diff --git a/src/streams/EditStreamScreen.js b/src/streams/EditStreamScreen.js index 0592e380ce1..06ab4acceb8 100644 --- a/src/streams/EditStreamScreen.js +++ b/src/streams/EditStreamScreen.js @@ -1,5 +1,6 @@ /* @flow strict-local */ import React, { useCallback } from 'react'; +import type { Node } from 'react'; import type { RouteProp } from '../react-navigation'; import type { AppNavigationProp } from '../nav/AppNavigator'; @@ -15,7 +16,7 @@ type Props = $ReadOnly<{| route: RouteProp<'edit-stream', {| streamId: number |}>, |}>; -export default function EditStreamScreen(props: Props) { +export default function EditStreamScreen(props: Props): Node { const dispatch = useDispatch(); const stream = useSelector(state => getStreamForId(state, props.route.params.streamId)); diff --git a/src/streams/InviteUsersScreen.js b/src/streams/InviteUsersScreen.js index c47ae7ae420..8ac2d48f7c2 100644 --- a/src/streams/InviteUsersScreen.js +++ b/src/streams/InviteUsersScreen.js @@ -1,5 +1,6 @@ /* @flow strict-local */ import React, { useState, useCallback } from 'react'; +import type { Node } from 'react'; import type { RouteProp } from '../react-navigation'; import type { AppNavigationProp } from '../nav/AppNavigator'; @@ -17,7 +18,7 @@ type Props = $ReadOnly<{| route: RouteProp<'invite-users', {| streamId: number |}>, |}>; -export default function InviteUsersScreen(props: Props) { +export default function InviteUsersScreen(props: Props): Node { const auth = useSelector(getAuth); const stream = useSelector(state => getStreamForId(state, props.route.params.streamId)); diff --git a/src/streams/StreamSettingsScreen.js b/src/streams/StreamSettingsScreen.js index a66536b0e64..e0d4c0eae3f 100644 --- a/src/streams/StreamSettingsScreen.js +++ b/src/streams/StreamSettingsScreen.js @@ -1,5 +1,6 @@ /* @flow strict-local */ import React, { useCallback } from 'react'; +import type { Node } from 'react'; import { View } from 'react-native'; import type { RouteProp } from '../react-navigation'; @@ -26,7 +27,7 @@ type Props = $ReadOnly<{| route: RouteProp<'stream-settings', {| streamId: number |}>, |}>; -export default function StreamSettingsScreen(props: Props) { +export default function StreamSettingsScreen(props: Props): Node { const dispatch = useDispatch(); const auth = useSelector(getAuth); diff --git a/src/streams/SubscriptionsCard.js b/src/streams/SubscriptionsCard.js index 3754ef6680f..049e9253c95 100644 --- a/src/streams/SubscriptionsCard.js +++ b/src/streams/SubscriptionsCard.js @@ -1,6 +1,7 @@ /* @flow strict-local */ import React, { useCallback } from 'react'; +import type { Node } from 'react'; import { View } from 'react-native'; import type { RouteProp } from '../react-navigation'; @@ -26,7 +27,7 @@ type Props = $ReadOnly<{| route: RouteProp<'subscribed', void>, |}>; -export default function SubscriptionsCard(props: Props) { +export default function SubscriptionsCard(props: Props): Node { const dispatch = useDispatch(); const subscriptions = useSelector(getSubscribedStreams); const unreadByStream = useSelector(getUnreadByStream); diff --git a/src/subscriptions/StreamListCard.js b/src/subscriptions/StreamListCard.js index f010979aef3..a2cd140dc0d 100644 --- a/src/subscriptions/StreamListCard.js +++ b/src/subscriptions/StreamListCard.js @@ -1,6 +1,7 @@ /* @flow strict-local */ import React, { useCallback } from 'react'; +import type { Node } from 'react'; import { View } from 'react-native'; import type { RouteProp } from '../react-navigation'; @@ -30,7 +31,7 @@ type Props = $ReadOnly<{| route: RouteProp<'allStreams', void>, |}>; -export default function StreamListCard(props: Props) { +export default function StreamListCard(props: Props): Node { const dispatch = useDispatch(); const auth = useSelector(getAuth); const canCreateStreams = useSelector(getCanCreateStreams); diff --git a/src/title/ActivityText.js b/src/title/ActivityText.js index a1a5933867c..0b9c844b10d 100644 --- a/src/title/ActivityText.js +++ b/src/title/ActivityText.js @@ -1,6 +1,7 @@ /* @flow strict-local */ import React from 'react'; +import type { Node } from 'react'; import type { TextStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet'; import type { UserOrBot } from '../types'; @@ -14,7 +15,7 @@ type Props = $ReadOnly<{| user: UserOrBot, |}>; -export default function ActivityText(props: Props) { +export default function ActivityText(props: Props): Node { const { style } = props; const presence = useSelector(state => getPresence(state)[props.user.email]); const userStatus = useSelector(state => getUserStatus(state)[props.user.user_id]); diff --git a/src/topics/TopicListScreen.js b/src/topics/TopicListScreen.js index 3579c9c7b37..a50edf8f9e8 100644 --- a/src/topics/TopicListScreen.js +++ b/src/topics/TopicListScreen.js @@ -1,6 +1,7 @@ /* @flow strict-local */ import React, { useState, useCallback, useEffect } from 'react'; +import type { Node } from 'react'; import type { RouteProp } from '../react-navigation'; import type { AppNavigationProp } from '../nav/AppNavigator'; @@ -17,7 +18,7 @@ type Props = $ReadOnly<{| route: RouteProp<'topic-list', {| streamId: number |}>, |}>; -export default function TopicListScreen(props: Props) { +export default function TopicListScreen(props: Props): Node { const dispatch = useDispatch(); const stream = useSelector(state => getStreamForId(state, props.route.params.streamId)); const topics = useSelector(state => getTopicsForStream(state, props.route.params.streamId)); diff --git a/src/user-status/UserStatusScreen.js b/src/user-status/UserStatusScreen.js index 29762d1b426..0af77962799 100644 --- a/src/user-status/UserStatusScreen.js +++ b/src/user-status/UserStatusScreen.js @@ -1,5 +1,6 @@ /* @flow strict-local */ import React, { useState, useContext, useCallback } from 'react'; +import type { Node } from 'react'; import { FlatList, View } from 'react-native'; import { TranslationContext } from '../boot/TranslationProvider'; import { createStyleSheet } from '../styles'; @@ -33,7 +34,7 @@ type Props = $ReadOnly<{| route: RouteProp<'user-status', void>, |}>; -export default function UserStatusScreen(props: Props) { +export default function UserStatusScreen(props: Props): Node { const dispatch = useDispatch(); const userStatusText = useSelector(getSelfUserStatusText);