React-select: Proposal: Display error message when the Promise fails

Created on 3 Feb 2017  路  2Comments  路  Source: JedWatson/react-select

When using Select.Async, if the promise fails the message displayed is noResultsText which is incorrect. The server may be overloaded or whatever, but it doesn't mean that there are no results.

Proposal:

Add an errorText props, and/or even better use the error message sent back by the promise.

errorText="Oops! Something bad happened."

/

promise.then(
  (data) => callback(null, data),
  (error) => callback(error) // <= use this
)

Most helpful comment

If anyone is interested, I did that as a workaround:

.catch((error) => {
  callback(null, {
    options: [{
      value: 'error',
      label: 'Oops! Something bad happened.',
      disabled: true,
  }],
})

All 2 comments

If anyone is interested, I did that as a workaround:

.catch((error) => {
  callback(null, {
    options: [{
      value: 'error',
      label: 'Oops! Something bad happened.',
      disabled: true,
  }],
})

Hello -

In an effort to sustain the react-select project going forward, we're closing old issues / pull requests.

We understand this might be inconvenient but in the best interest of supporting the broader community we have to direct our limited efforts to maintain the latest version.

If you feel this issue / pull request is still relevant and you'd like us to review it, please leave a comment and we'll do our best to get back to you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sampatbadhe picture sampatbadhe  路  3Comments

AchinthaReemal picture AchinthaReemal  路  3Comments

x-yuri picture x-yuri  路  3Comments

pgoldweic picture pgoldweic  路  3Comments

pablote picture pablote  路  3Comments