From 541c6710a82eee3106cae7fc9f98817c8368f6d4 Mon Sep 17 00:00:00 2001 From: Sonny Mai Date: Mon, 30 Nov 2015 14:35:01 +1100 Subject: [PATCH] Allow unique ID to be passed in. --- src/components/typeahead.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/typeahead.jsx b/src/components/typeahead.jsx index 6d209a5..adb80e0 100644 --- a/src/components/typeahead.jsx +++ b/src/components/typeahead.jsx @@ -20,6 +20,7 @@ module.exports = React.createClass({ }, propTypes: process.env.NODE_ENV === 'production' ? {} : { + uniqueId: React.PropTypes.string, inputId: React.PropTypes.string, inputName: React.PropTypes.string, className: React.PropTypes.string, @@ -86,7 +87,9 @@ module.exports = React.createClass({ componentWillMount: function() { var _this = this, - uniqueId = this.constructor.getInstanceCount(); + uniqueId = this.props.uniqueId + ? this.props.uniqueId + : this.constructor.getInstanceCount(); _this.userInputValue = null; _this.previousInputValue = null;