From 751d76cfc574b195a760e59aae0f3f89e6c4b334 Mon Sep 17 00:00:00 2001 From: "Walton, Reese" Date: Tue, 8 Aug 2017 18:53:37 -0400 Subject: [PATCH] noResultsText can be React Component --- types/react-select/index.d.ts | 4 ++-- types/react-select/react-select-tests.tsx | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/types/react-select/index.d.ts b/types/react-select/index.d.ts index abfed81047..877b2557a0 100644 --- a/types/react-select/index.d.ts +++ b/types/react-select/index.d.ts @@ -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) */ diff --git a/types/react-select/react-select-tests.tsx b/types/react-select/react-select-tests.tsx index 13d64d32ce..8b834d1bb6 100644 --- a/types/react-select/react-select-tests.tsx +++ b/types/react-select/react-select-tests.tsx @@ -171,4 +171,12 @@ describe("Examples", () => { valueRenderer={props => null} />; }); + + it("No Results renderer with string", () => { + ; + }); + + it("No Results renderer with element", () => { + no results} />; + }); });