noResultsText can be React Component

This commit is contained in:
Walton, Reese
2017-08-08 19:06:21 -04:00
parent 825d361b8e
commit 751d76cfc5
2 changed files with 10 additions and 2 deletions
+2 -2
View File
@@ -284,7 +284,7 @@ declare namespace ReactSelectClass {
* placeholder displayed when there are no matching search results or a falsy value to hide it
* @default "No results found"
*/
noResultsText?: string;
noResultsText?: string | JSX.Element;
/**
* onBlur handler: function (event) {}
*/
@@ -494,7 +494,7 @@ declare namespace ReactSelectClass {
/**
* placeholder displayed when there are no matching search results (shared with Select)
*/
noResultsText?: string;
noResultsText?: string | JSX.Element;
/**
* field placeholder; displayed when there's no value (shared with Select)
*/
@@ -171,4 +171,12 @@ describe("Examples", () => {
valueRenderer={props => null}
/>;
});
it("No Results renderer with string", () => {
<ReactSelect noResultsText="no results" />;
});
it("No Results renderer with element", () => {
<ReactSelect noResultsText={<i>no results</i>} />;
});
});