// @flow import * as React from 'react'; import classnames from 'classnames'; import SimpleMDE from 'react-simplemde-editor'; import style from 'react-simplemde-editor/dist/simplemde.min.css'; // eslint-disable-line no-unused-vars type Props = { name: string, label?: string, render?: () => React.Node, prefix?: string, postfix?: string, error?: string | boolean, helper?: string | React.Node, type?: string, onChange?: any => any, defaultValue?: string | number, placeholder?: string | number, children?: React.Node, stretch?: boolean, }; export class FormField extends React.PureComponent { render() { const { render, label, prefix, postfix, error, helper, name, type, children, stretch, ...inputProps } = this.props; const errorMessage = typeof error === 'object' ? error.message : error; let input; if (type) { if (type === 'select') { input = ( ); } else if (type === 'markdown') { input = (
); } else if (type === 'textarea') { input =