ES6 assets/js/src/form/fields/textarea.jsx

This commit is contained in:
Amine Ben hammou
2018-04-18 15:59:24 +02:00
parent b053bb395c
commit d638273f47

View File

@@ -1,26 +1,17 @@
define([
'react',
],
(
React
) => {
const FormFieldTextarea = React.createClass({
render: function render() {
return (
<textarea
type="text"
className="regular-text"
name={this.props.field.name}
id={`field_${this.props.field.name}`}
value={this.props.item[this.props.field.name]}
placeholder={this.props.field.placeholder}
defaultValue={this.props.field.defaultValue}
onChange={this.props.onValueChange}
{...this.props.field.validation}
/>
);
},
});
import React from 'react';
return FormFieldTextarea;
});
const FormFieldTextarea = () => (
<textarea
type="text"
className="regular-text"
name={this.props.field.name}
id={`field_${this.props.field.name}`}
value={this.props.item[this.props.field.name]}
placeholder={this.props.field.placeholder}
defaultValue={this.props.field.defaultValue}
onChange={this.props.onValueChange}
{...this.props.field.validation}
/>
);
export default FormFieldTextarea;