diff --git a/src/AsyncCreatable.js b/src/AsyncCreatable.js
index 4bd3099b8b..49a8c2b4a7 100644
--- a/src/AsyncCreatable.js
+++ b/src/AsyncCreatable.js
@@ -7,19 +7,42 @@ const AsyncCreatable = React.createClass({
render () {
return (
- {(asyncProps) => (
-
- {(creatableProps) => (
-
- )}
+ {({ref, ...asyncProps}) => {
+ const asyncRef = ref
+ return
+ {({ref, ...creatableProps}) => {
+ const creatableRef = ref
+ return this.props.children({
+ ...creatableProps,
+ ref: (select) => {
+ creatableRef(select)
+ asyncRef(select)
+ this.select = select
+ }
+ })
+ }}
- )}
+ }}
);
}
});
+function defaultChildren (props) {
+ return (
+
+ );
+};
+
+const propTypes = {
+ children: React.PropTypes.func.isRequired, // Child function responsible for creating the inner Select component; (props: Object): PropTypes.element
+}
+
+const defaultProps = {
+ children: defaultChildren,
+}
+
+Async.propTypes = propTypes;
+Async.defaultProps = defaultProps;
+
module.exports = AsyncCreatable;