11/* @flow strict-local */
2- import React , { useState , useRef , useCallback , useContext } from 'react' ;
2+ import React , { useState , useCallback , useContext } from 'react' ;
33import type { Node } from 'react' ;
44import { TextInput , View } from 'react-native' ;
55import { useFocusEffect } from '@react-navigation/native' ;
@@ -28,11 +28,7 @@ type Props = $ReadOnly<{|
2828export default function SmartUrlInput ( props : Props ) : Node {
2929 const { onChangeText, onSubmitEditing } = props ;
3030
31- // We should replace the fixme with
32- // `React$ElementRef<typeof TextInput>` when we can. Currently, that
33- // would make `.current` be `any(implicit)`, which we don't want;
34- // this is probably down to bugs in Flow's special support for React.
35- const textInputRef = useRef < $FlowFixMe > ( ) ;
31+ const textInputRef = React . useRef < React$ElementRef < typeof TextInput > | null > ( null ) ;
3632
3733 const [ value , setValue ] = useState < string > ( '' ) ;
3834
@@ -51,8 +47,6 @@ export default function SmartUrlInput(props: Props): Node {
5147 // screen, sometimes the keyboard flicks open then closed, instead
5248 // of just opening. Shrug. See
5349 // https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/realm-input/near/1346690
54- //
55- // `.current` is not type-checked; see definition.
5650 textInputRef . current . focus ( ) ;
5751 }
5852 } , [ ] ) ,
0 commit comments