diff --git a/examples/playground/src/App.js b/examples/playground/src/App.js index 53ccaa7..50545ab 100644 --- a/examples/playground/src/App.js +++ b/examples/playground/src/App.js @@ -49,7 +49,9 @@ class App extends Component { onChangeOption={this.handleChangeOption} onToggle={this.handleToggleOptions} /> -

Layout: {layout}

+

+ Layout: {layout} +

{ myform = form; }; - const legend = str => {str}; + const legend = str => ( + {str} + ); return (
component', () => { it('has an `aria-invalid="true"` prop on the form control when validation has failed', () => {}); it('has an `aria-required="true"` prop on the form control when validation is required', () => {}); - }); describe('Input components do this', () => { diff --git a/src/components/error-messages.js b/src/components/error-messages.js index 484b2ab..19e7e07 100644 --- a/src/components/error-messages.js +++ b/src/components/error-messages.js @@ -4,9 +4,7 @@ import PropTypes from 'prop-types'; const ErrorMessages = ({messages}) => { const messageNodes = messages.map((message, key) => ( // eslint-disable-next-line react/no-array-index-key -
- {message} -
+
{message}
)); return
{messageNodes}
; }; diff --git a/src/components/form-check-group.js b/src/components/form-check-group.js index bfaec92..488133d 100644 --- a/src/components/form-check-group.js +++ b/src/components/form-check-group.js @@ -2,9 +2,17 @@ import React from 'react'; import ErrorMessages from './error-messages'; import Help from './help'; import Row from './row'; +import {componentPropTypes, componentDefaultProps} from './component-common'; const FormCheckGroup = props => { - const { layout, help, showErrors, errorMessages, labelClassName, children } = props; + const { + layout, + help, + showErrors, + errorMessages, + labelClassName, + children, + } = props; if (layout === 'elementOnly') { return children; @@ -19,4 +27,7 @@ const FormCheckGroup = props => { ); }; +FormCheckGroup.propTypes = componentPropTypes; +FormCheckGroup.defaultProps = componentDefaultProps; + export default FormCheckGroup;