node package manager
Easy collaboration. Discover, share, and reuse code in your team. Create a free org ยป


Editable DIV

React Component that enables editable divs.

Source on github


% npm install react-editablev-div --save


Optionally send in 'editable' as true/false in cause you want to only want to set editable for certain users.

In the 'onChange' function, set up any method you want to store the new value.


var Editable = require('react-editable-div');
MyComponent = React.createClass({
  onChange: function (e) {
      // Use either
      // or:

  render: function() {
     return (
        <Editable editable={this.state.editable}
                       html="<b>H</b>el<b>lo </b><i><b>W</b>or<b>l</b>d<b>!</b></i>"
                       ref="editable" onChange={this.onChange} />