From cddee251a9460abe140fa1fb9623b912188a4485 Mon Sep 17 00:00:00 2001 From: Romain Dardour Date: Fri, 18 Nov 2016 12:37:49 +0100 Subject: [PATCH] fix AsyncCreatable options parsing fixes https://github.com/JedWatson/react-select/issues/1279 --- src/AsyncCreatable.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/AsyncCreatable.js b/src/AsyncCreatable.js index 12b8ad540c..edc51ee10b 100644 --- a/src/AsyncCreatable.js +++ b/src/AsyncCreatable.js @@ -1,6 +1,15 @@ import React from 'react'; import Select from './Select'; +function reduce(obj, props = {}){ + return Object.keys(obj) + .reduce((props, key) => { + const value = obj[key]; + if (value !== undefined) props[key] = value; + return props; + }, props); +} + const AsyncCreatable = React.createClass({ displayName: 'AsyncCreatableSelect', @@ -11,12 +20,15 @@ const AsyncCreatable = React.createClass({ {(creatableProps) => (