Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 519 Bytes

README.md

File metadata and controls

22 lines (18 loc) · 519 Bytes

react-contenteditable

React component for a div with editable contents

Usage

  var ContentEditable = require("react-contenteditable");
  var MyComponent = React.createClass({
    getInitialState: function(){
      return {html: "<b>Hello <i>World</i></b>"};
    },

    handleChange: function(evt){
      this.setState({html: evt.target.value});
    },

    render: function(){
      return <ContentEditable html={this.state.html} onChange={this.handleChange}/>
    }
  });