From cc14a78043949fbeb1facbafae04805085869a37 Mon Sep 17 00:00:00 2001 From: Derrick Liu Date: Thu, 5 May 2016 10:17:45 -0800 Subject: [PATCH] react-select: update props to match Select and Async source files (#9127) * Add an export for Option so we can use it directly * Update tests to import the newly exported Option * Add missing props from latest `react-select` 1.0.0-beta12 * Add menuRenderer function and interface for its named props * This argument should be optional. * `tabSelectsValue` should be a boolean, not a string * Update tests with new props * Export menu renderer props so devs can write typesafe `menuRenderer` functions * Make sure to check exports in tests, since it's likely users won't be using --- react-select/react-select-tests.tsx | 35 +++++- react-select/react-select.d.ts | 169 ++++++++++++++++++++++------ 2 files changed, 167 insertions(+), 37 deletions(-) diff --git a/react-select/react-select-tests.tsx b/react-select/react-select-tests.tsx index 8e4571f472..57bef47be2 100644 --- a/react-select/react-select-tests.tsx +++ b/react-select/react-select-tests.tsx @@ -5,16 +5,25 @@ import * as React from "react"; import * as ReactDOM from "react-dom"; -import Select, { Option } from "react-select"; +import Select, { Option, MenuRendererProps } from "react-select"; class SelectTest extends React.Component, {}> { render() { const options: Option[] = [{ label: "Foo", value: "bar" }]; const onChange = (value: any) => console.log(value); + const renderMenu = ({ + focusedOption, + focusOption, + labelKey, + options, + selectValue, + valueArray + }: MenuRendererProps) => { return
}; const onOpen = () => { return; }; const onClose = () => { return; }; const optionRenderer = (option: Option) => {option.label} + return