forked from pmyers88/react-wysiwyg-editor
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathExample.js
More file actions
33 lines (28 loc) · 705 Bytes
/
Example.js
File metadata and controls
33 lines (28 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
'use strict';
var React = require('react'),
EditableDiv = require('./EditableDiv.jsx');
module.exports = React.createClass({
displayName: 'Example',
getInitialState: function() {
return {
content: '' // initial content
};
},
handleContentChange: function(e) {
this.setState({content: e.target.value});
},
render: function() {
var editorStyle = {
overflow: 'auto',
width: 300,
height: 100,
maxHeight: 100
}
return(
React.createElement("div", {className: "form-group"},
React.createElement("label", null, "Comment:"),
React.createElement(EditableDiv, {style: editorStyle, content: this.state.content, onChange: this.handleContentChange})
)
);
}
});