fmoo / react-typeahead

Pure react-based typeahead and typeahead-tokenizer
ISC License
677 stars 231 forks source link

error since update from 1.1.1 to 1.1.2 #106

Closed barbalex closed 9 years ago

barbalex commented 9 years ago

I now get this message in the console:

Warning: Failed propType: Invalid prop `customListComponent` supplied to `Typeahead`, expected a ReactElement. Check the render method of `Filter`

I'm rendering like this:

return (
  <div id='filter'>
    <div style={{position: 'relative'}}>
      <Glyphicon
        glyph={'remove'}
        style={removeGlyphStyle}
        onClick={this.onClickEmptyFilterField}/>
      <Typeahead
        ref={'typeahead'}
        placeholder={'filtern'}
        maxVisible={10}
        options={options}
        filterOption={'label'}
        displayOption={'label'}
        onOptionSelected={this.onSelectObject}
        customClasses={{
          'input': ['form-control'],
          'results': ['list-group'],
          'listItem': ['list-group-item']
        }}/>
    </div>
  </div>
)

Filtering works though.

leecrossley commented 9 years ago

I'm also seeing this warning

fmoo commented 9 years ago

@lPadier - this is related to your changes, any particular guidance on how to address this? (feel free to send me a PR).

trshafer commented 9 years ago

same

alanrubin commented 9 years ago

Same here

lPadier commented 9 years ago

I've just checked the source for ReactTransitionGroup that takes a component as a Prop, and they use React.PropTypes.any

https://github.com/facebook/react/blob/master/src/addons/transitions/ReactTransitionGroup.js

At best we can check that it is a function, but there does not seem to be a proper PropType for a component class, and not a component instance.

fmoo commented 9 years ago

Should be fixed in 1.1.3; please retest.

barbalex commented 9 years ago

works, thanks a lot

leecrossley commented 9 years ago

I can confirm this fix works, thanks.