From d29b31e5dba366eba1a4f41d2ac42d616115ee6f Mon Sep 17 00:00:00 2001 From: Sam Walsh Date: Wed, 25 Apr 2018 11:13:27 +1200 Subject: [PATCH] @types/material-ui -ToggleProps.label change string to React.ReactNode (#25241) * @types/material-ui - Change `ToggleProps` `label` type to `React.ReactNode` instead of `string` * Amend samwalshnz github username to authors list for material-ui --- types/material-ui/index.d.ts | 3 ++- types/material-ui/material-ui-tests.tsx | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/material-ui/index.d.ts b/types/material-ui/index.d.ts index 8c7a49c96d..307ce84115 100644 --- a/types/material-ui/index.d.ts +++ b/types/material-ui/index.d.ts @@ -11,6 +11,7 @@ // Artyom Stukans // Dan Jones // Daisuke Mino +// Sam Walsh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -1583,7 +1584,7 @@ declare namespace __MaterialUI { elementStyle?: React.CSSProperties; iconStyle?: React.CSSProperties; inputStyle?: React.CSSProperties; - label?: string; + label?: React.ReactNode; labelPosition?: "left" | "right"; labelStyle?: React.CSSProperties; onToggle?(e: React.MouseEvent<{}>, isInputChecked: boolean): void; diff --git a/types/material-ui/material-ui-tests.tsx b/types/material-ui/material-ui-tests.tsx index a416670d0d..a7bb59fcf8 100644 --- a/types/material-ui/material-ui-tests.tsx +++ b/types/material-ui/material-ui-tests.tsx @@ -5709,6 +5709,10 @@ const ToggleExampleSimple = () => ( label="Simple" style={styles.toggle} /> + Element} + style={styles.toggle} + />