import React from 'react'; import PropTypes from 'prop-types'; const FormField = props => { const field = props.field; let val = props.account[field]; if (props.field.includes('.')) { const [parent, key] = props.field.split('.'); val = props.account[parent][key]; } return ( ); }; FormField.propTypes = { field: PropTypes.string, title: PropTypes.string, type: PropTypes.string, style: PropTypes.object, submitting: PropTypes.bool, onFieldKeyPress: PropTypes.func, onFieldChange: PropTypes.func, errorFieldNames: PropTypes.array, account: PropTypes.object, }; export default FormField;