1.0.5 • Published 5 years ago

react-editinplace v1.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

react-editinplace

Simple React component for editing in place.

Installation

npm install react-editinplace --save-dev

Example

var React = require('react'),
    EditInPlace = require('react-editinplace'),

    YourPage = React.createClass({
        getInitialState() {
            return {};

        },


        // validate input text
        _validate(text) {
            if (text.length > 0) {
                return true;
            }

            return false;

        },

        // save text to model etc.
        _onChange(text) {

        },

        render() {

            return <div className="yourpage">
                <EditInPlace
                    text="Some text"
                    editType="dblClick"
                    className="editinplace"
                    maxLength={10}
                    validate={this._validate}
                    activeClassName="active"
                    onChange={this._onChange} />
            </div>;

        }
    });

module.exports = YourPage;
1.0.5

5 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago