diff --git a/lib/RadioButtonGroup/RadioButtonGroup.js b/lib/RadioButtonGroup/RadioButtonGroup.js index 4e44fb827..7e3ac8576 100644 --- a/lib/RadioButtonGroup/RadioButtonGroup.js +++ b/lib/RadioButtonGroup/RadioButtonGroup.js @@ -6,13 +6,13 @@ import css from './RadioButtonGroup.css'; const propTypes = { children: PropTypes.node.isRequired, - error: PropTypes.node, + error: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), onBlur: PropTypes.func, onChange: PropTypes.func, onFocus: PropTypes.func, value: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]), - warning: PropTypes.string + warning: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), }; function RadioButtonGroup(props) { diff --git a/lib/RadioButtonGroup/readme.md b/lib/RadioButtonGroup/readme.md index 7004421b7..af9604293 100644 --- a/lib/RadioButtonGroup/readme.md +++ b/lib/RadioButtonGroup/readme.md @@ -4,9 +4,35 @@ Convenient wrapper component for sets of radio buttons. Will pass `name` prop as The component will automatically render radio buttons within a `` with the value for the `label` prop applied as a ``. Non-`` children can also be passed for alternative layouts, but **RadioButtons should still be direct descendants**. ## Usage -Example with redux-form `` component: +Example with react-final-form: +```js + + +

Sponsor

+ + + + +
``` + +Example with react-final-form via render-prop: +```js + + + +

Sponsor

+ + + + +
+} /> +``` + +Example with redux-form: +```js

Sponsor

@@ -21,10 +47,10 @@ Example with redux-form `` component: Name | type | description | default | required | --- | --- | --- | --- | --- | children | node or array of nodes | Set of ``s for usage. Can include other tags (headers, spans, etc.) | | ✔| -error | string | | | | +error | string or node | Error message to display | | | label | string or node | Content to render in the `` tag of the created `
`. | | | `onBlur` | func | | | `onChange` | func | | | `onFocus` | func | | | value | string | Sets default value for radio button set - **Not necessary for redux-form - will use the form's initialValues prop instead** | | | -warning | string | | | | +warning | string or node | Warning text to display | | |