ES6 assets/js/src/form/fields/textarea.jsx
This commit is contained in:
@@ -1,26 +1,17 @@
|
|||||||
define([
|
import React from 'react';
|
||||||
'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}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
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;
|
||||||
|
Reference in New Issue
Block a user