Closed mhendyl closed 2 years ago
@Lg0gs @Thanhal-P-A can you guys approve the PR, it's a very important feature?
Try to implement it like this. There shouldn't be the need to introduce a new prop.
function SomeComponent() {
const inputEl = useRef(null);
return (
<Autocomplete
// ...
renderTextInput={(props) => <TextInput {...props} ref={inputEl} />}
/>
)
}
<TextInput {...props} ref={inputEl} />
@mrlaessig thanks buddy, but still I feel this approach will be good if we use this package as a wrapper, but for someone who is directly using this package everywhere in their codebase, it'll not be ideal to refactor it everywhere. Anyway till the time there is a permanent solution or a prop is available we can go on like this.
Resolved within #243. Now you can set the ref
prop in the autocomplete to get a reference to the text input.
please approve this merge i need this ref prop for textinput