1
1
/* @flow strict-local */
2
- import React , { useState , useRef , useCallback , useContext } from 'react' ;
2
+ import React , { useState , useCallback , useContext } from 'react' ;
3
3
import type { Node } from 'react' ;
4
4
import { TextInput , View } from 'react-native' ;
5
5
import { useFocusEffect } from '@react-navigation/native' ;
@@ -28,11 +28,7 @@ type Props = $ReadOnly<{|
28
28
export default function SmartUrlInput ( props : Props ) : Node {
29
29
const { onChangeText, onSubmitEditing } = props ;
30
30
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 ) ;
36
32
37
33
const [ value , setValue ] = useState < string > ( '' ) ;
38
34
@@ -51,8 +47,6 @@ export default function SmartUrlInput(props: Props): Node {
51
47
// screen, sometimes the keyboard flicks open then closed, instead
52
48
// of just opening. Shrug. See
53
49
// https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/realm-input/near/1346690
54
- //
55
- // `.current` is not type-checked; see definition.
56
50
textInputRef . current . focus ( ) ;
57
51
}
58
52
} , [ ] ) ,
0 commit comments