Skip to content

Commit

Permalink
StorageScreen [nfc]: Use useSelector instead of connect.
Browse files Browse the repository at this point in the history
An instance of zulip#4837.
  • Loading branch information
chrisbobbe committed Jul 1, 2021
1 parent 3372dc9 commit 854f666
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/diagnostics/StorageScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { FlatList } from 'react-native';

import type { RouteProp } from '../react-navigation';
import type { AppNavigationProp } from '../nav/AppNavigator';
import type { GlobalState, Dispatch } from '../types';
import { connect } from '../react-redux';
import { useSelector } from '../react-redux';
import { Screen } from '../common';
import SizeItem from './SizeItem';

Expand All @@ -21,13 +20,10 @@ const calculateKeyStorageSizes = obj =>
type Props = $ReadOnly<{|
navigation: AppNavigationProp<'storage'>,
route: RouteProp<'storage', void>,

dispatch: Dispatch,
state: GlobalState,
|}>;

function StorageScreen(props: Props) {
const { state } = props;
export default function StorageScreen(props: Props) {
const state = useSelector(s => s);
const storageSizes = calculateKeyStorageSizes(state);

return (
Expand All @@ -40,7 +36,3 @@ function StorageScreen(props: Props) {
</Screen>
);
}

export default connect(state => ({
state,
}))(StorageScreen);

0 comments on commit 854f666

Please sign in to comment.