1

I'm trying to use the react-native-paper TextInput as a field to show a location search input. This doesn't seem to work because the ref property on this component doesn't get registered. How can I add a ref property to this field?

chackerian
  • 1,301
  • 2
  • 15
  • 29

1 Answers1

0
import * as React from 'react';
import { TextInput } from 'react-native-paper';

 const [text, setText] = React.useState("");
 const textRef=React.useRef(); //add this

 <TextInput
      ref={textRef} //add this
      label="Email"
      value={text}
      onChangeText={text => setText(text)}
    />
  • I tried this, the problem is that this component is suitable for google maps location search because it isn't a htmlinputelement. – chackerian Jul 30 '22 at 23:34