-
Thanks for creating a great and helpful library! I'm trying to upgrade from 4.x to the latest (currently 6.2.3) and have a question about what type to use when creating my own reference. Using the example from Methods.md, what type should the reference have? const ref = React.createRef<~>();
^ what type here?
<>
<Typeahead
...
ref={ref}
/>
<button onClick={() => ref.current.clear()}>
Clear Typeahead
</button>
</> I've also created a sandbox, if anyone wants to mess around (the most recent version of or, if I update it to be Any help would be greatly appreciated. Regardless, thanks again for this sweet library! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @kwburnett, thanks for the question! As of v6.2, you can import import { Typeahead, TypeaheadRef } from 'react-bootstrap-typeahead';
...
const ref = useRef<TypeaheadRef>(); |
Beta Was this translation helpful? Give feedback.
Hey @kwburnett, thanks for the question! As of v6.2, you can import
TypeaheadRef
from the package and use that to type the ref: