From 5b76a7fe781a74a6a5ddb7d1f0b31de7fc8530b0 Mon Sep 17 00:00:00 2001 From: Javi Velasco Date: Sun, 19 Jun 2016 21:37:46 +0200 Subject: [PATCH] Fix #536 --- components/checkbox/Checkbox.js | 5 ++++- components/checkbox/readme.md | 2 +- components/radio/RadioButton.js | 5 ++++- components/radio/readme.md | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/components/checkbox/Checkbox.js b/components/checkbox/Checkbox.js index 0abc86e6..5f7128ea 100644 --- a/components/checkbox/Checkbox.js +++ b/components/checkbox/Checkbox.js @@ -11,7 +11,10 @@ const factory = (Check) => { checked: PropTypes.bool, className: PropTypes.string, disabled: PropTypes.bool, - label: PropTypes.any, + label: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.node + ]), name: PropTypes.string, onChange: PropTypes.func, theme: PropTypes.shape({ diff --git a/components/checkbox/readme.md b/components/checkbox/readme.md index a8fa8660..a6d1d0f0 100644 --- a/components/checkbox/readme.md +++ b/components/checkbox/readme.md @@ -46,7 +46,7 @@ If you want to provide a theme via context, the component key is `RTCheckbox`. | `checked` | `Boolean` | `false` | Value for the checkbox, can be `true` or `false`. | | `className` | `String` | `''` | Sets a class to give customized styles to the checkbox field.| | `disabled` | `Boolean` | `false` | If true, the checkbox shown as disabled and cannot be modified.| -| `label` | `String` | | Text label to attach next to the checkbox element.| +| `label` | `String` of `node` | | Text label to attach next to the checkbox element.| | `name` | `String` | `false` | The name of the field to set in the input checkbox.| | `onBlur` | `Function` | | Callback called when the checkbox is blurred.| | `onChange` | `Function` | | Callback called when the checkbox value is changed.| diff --git a/components/radio/RadioButton.js b/components/radio/RadioButton.js index 4ac6871a..85a4e279 100644 --- a/components/radio/RadioButton.js +++ b/components/radio/RadioButton.js @@ -11,7 +11,10 @@ const factory = (Radio) => { checked: PropTypes.bool, className: PropTypes.string, disabled: PropTypes.bool, - label: PropTypes.string, + label: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.node + ]), name: PropTypes.string, onBlur: PropTypes.func, onChange: PropTypes.func, diff --git a/components/radio/readme.md b/components/radio/readme.md index dcdae9b1..0e95454e 100644 --- a/components/radio/readme.md +++ b/components/radio/readme.md @@ -56,7 +56,7 @@ The inner component to compose radio selectors. They will be rendered as radio i | `checked` | `Boolean` | `false` | If true, the input element will be selected by default. Transferred from the parent. | | `className` | `String` | `''` | Set a class to give custom styles to the radio button.| | `disabled` | `Boolean` | `false` | If true, the item will be displayed as disabled.| -| `label` | `String` | `''` | Label for the radio button.| +| `label` | `String` of `node` | `''` | Label for the radio button.| | `name` | `String` | | Name for the input element. | | `onBlur` | `Function` | | Callback function that will be invoked when the input is blurred. | | `onChange` | `Function` | | Callback function that will be invoked when the value changes. |