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

Specify a ReactClass instead of the std input html tag

Open vadmeste opened this issue 9 years ago • 7 comments

Since react-typeahead is a react library, this pull request helps the user to specifiy a react class in replacement of the standard input html tag, this pull request is not complete until the original idea is discussed

vadmeste avatar Mar 03 '15 18:03 vadmeste

This is an really interesting stuff which i would use essentially at - https://github.com/Minio-io/polygon

harshavardhana avatar Mar 06 '15 01:03 harshavardhana

it seems that React.PropTypes.instanceOf(ReactCompositeComponent) doesn't work, it shows this warning msg "Failed propType: invalid 'instanceof' operand expectedClass".

Also, I found this ticket https://github.com/facebook/react/issues/2374 which might lead us to conclude that is enough to test the react class against the function type

vadmeste avatar Mar 11 '15 20:03 vadmeste

Well, when the developer want to use his own custom and complicated react class instead of the standard input element, inputQuerySel will help to specify which element that has to be treated by typeahead.. I will see if mixins could fit in this case..

vadmeste avatar Mar 23 '15 19:03 vadmeste

Any news for the ability to provide custom element? I would like to be able to use Typeahead with a <textarea> element.

:+1: on this PR.

OtaK avatar Jun 13 '15 18:06 OtaK

ReactTransitionGroup uses component={component} as the prop name when rendering a different component: https://facebook.github.io/react/docs/animation.html#rendering-a-different-component . Just a thought instead of CustomComponent.

trshafer avatar Jun 17 '15 20:06 trshafer

In the same vein, It would be interesting to be able to replace the TypeaheadSelector by a React component in order to add the possibility of different behaviors to it:

  • Empty hint message,
  • Complex views (for instance for a user typeahead, show some profile information)

lPadier avatar Jun 30 '15 14:06 lPadier

According to the documentation, the correct PropType for React Components is React.PropTypes.element http://facebook.github.io/react/docs/reusable-components.html

lPadier avatar Jul 06 '15 13:07 lPadier