UNPKG

@e-group/material-form

Version:

Custom react components for integrate redux-form.

28 lines (25 loc) 870 B
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import React from 'react'; import PropTypes from 'prop-types'; import Radio from '@e-group/material/Radio'; const RadioField = (_ref) => { let radioValue = _ref.radioValue, _ref$input = _ref.input, value = _ref$input.value, otherInput = _objectWithoutProperties(_ref$input, ["value"]), meta = _ref.meta, other = _objectWithoutProperties(_ref, ["radioValue", "input", "meta"]); return /*#__PURE__*/React.createElement(Radio, _extends({ value: radioValue, checked: radioValue === value }, otherInput, other)); }; RadioField.propTypes = { /** * redux from props */ input: PropTypes.object.isRequired, meta: PropTypes.object.isRequired }; export default RadioField;