diff --git a/src/streams/EditStreamScreen.js b/src/streams/EditStreamScreen.js index 04b56cafb33..0592e380ce1 100644 --- a/src/streams/EditStreamScreen.js +++ b/src/streams/EditStreamScreen.js @@ -4,27 +4,20 @@ import React, { useCallback } from 'react'; import type { RouteProp } from '../react-navigation'; import type { AppNavigationProp } from '../nav/AppNavigator'; import * as NavigationService from '../nav/NavigationService'; -import type { Dispatch, Stream } from '../types'; -import { connect } from '../react-redux'; +import { useSelector, useDispatch } from '../react-redux'; import { updateExistingStream, navigateBack } from '../actions'; import { getStreamForId } from '../selectors'; import { Screen } from '../common'; import EditStreamCard from './EditStreamCard'; -type SelectorProps = $ReadOnly<{| - stream: Stream, -|}>; - type Props = $ReadOnly<{| navigation: AppNavigationProp<'edit-stream'>, route: RouteProp<'edit-stream', {| streamId: number |}>, - - dispatch: Dispatch, - ...SelectorProps, |}>; -function EditStreamScreen(props: Props) { - const { dispatch, stream } = props; +export default function EditStreamScreen(props: Props) { + const dispatch = useDispatch(); + const stream = useSelector(state => getStreamForId(state, props.route.params.streamId)); const handleComplete = useCallback( (name: string, description: string, isPrivate: boolean) => { @@ -48,7 +41,3 @@ function EditStreamScreen(props: Props) { ); } - -export default connect((state, props) => ({ - stream: getStreamForId(state, props.route.params.streamId), -}))(EditStreamScreen);