react-typeahead icon indicating copy to clipboard operation
react-typeahead copied to clipboard

Remote data support

Open vincenzo-antolini-os opened this issue 9 years ago • 5 comments

Hi, is remote data supported?

Thanks in advance V

vincenzo-antolini-os avatar Jun 20 '15 09:06 vincenzo-antolini-os

I have the same question. I don't see anything mentioned about remote data support in the docs. Thanks

sriprabha avatar Sep 10 '15 19:09 sriprabha

Wouldn't you simply have a parent element which deals with the remote data and pass it as a property to the type ahead? Not sure if I am missing a more specific use case here.

On Thursday, September 10, 2015, Sriprabha [email protected] wrote:

I have the same question. I don't see anything mentioned about remote data support in the docs. Thanks

— Reply to this email directly or view it on GitHub https://github.com/fmoo/react-typeahead/issues/84#issuecomment-139352207 .

thehuey avatar Sep 11 '15 01:09 thehuey

this is about providing the ability to fetch data from a remote source and filter it based on each character entered in the typeahead, that is, and display the filtered results in the dropdown for the typeahead.

sriprabha avatar Sep 11 '15 04:09 sriprabha

@vincenzo-antolini-os did you managed to use this component with remote data? It would be useful to have an example on the readme...the scenario is quite usual.

thx

emadb avatar Dec 15 '15 17:12 emadb

I managed to bind dynamic remote data attaching to the onKeyUp event

  handleKeyUp() {
    if (arguments[0].target) {
      const inputValue = arguments[0].target.value;

      fetch(`your end point here ${inputValue}`)
        .then(res => {
          return res.json();
        })
        .then(data => {
          this.setState({ options: data.results });
        });
    }
  }

giacomorebonato avatar Feb 10 '16 12:02 giacomorebonato