From 2e37a5d36f39f8ec690f649b169eeea6dabc1ca4 Mon Sep 17 00:00:00 2001 From: Daniel Heath Date: Thu, 29 Sep 2016 14:48:40 +1000 Subject: [PATCH] Allow react nodes to be passed as loadingPlaceholder Everywhere we use loadingPlaceholder already supports `node` or `string`, so no other changes should be required if I'm reading correctly. --- src/Async.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Async.js b/src/Async.js index 136338d337..43798d2ae0 100644 --- a/src/Async.js +++ b/src/Async.js @@ -8,7 +8,10 @@ const propTypes = { children: React.PropTypes.func.isRequired, // Child function responsible for creating the inner Select component; (props: Object): PropTypes.element ignoreAccents: React.PropTypes.bool, // strip diacritics when filtering; defaults to true ignoreCase: React.PropTypes.bool, // perform case-insensitive filtering; defaults to true - loadingPlaceholder: PropTypes.string.isRequired, // replaces the placeholder while options are loading + loadingPlaceholder: React.PropTypes.oneOfType([ // replaces the placeholder while options are loading + React.PropTypes.string, + React.PropTypes.node + ]), loadOptions: React.PropTypes.func.isRequired, // callback to load options asynchronously; (inputValue: string, callback: Function): ?Promise options: PropTypes.array.isRequired, // array of options placeholder: React.PropTypes.oneOfType([ // field placeholder, displayed when there's no value (shared with Select)