Skip to content

Latest commit

 

History

History
72 lines (48 loc) · 1.25 KB

README.md

File metadata and controls

72 lines (48 loc) · 1.25 KB

React-Text-Edit

NPM Version License

A text editor components written with React.

Installation

NPM

$ npm install react-text-edit --save

Usage

import React, {Component} from 'react';
import ReactTextEdit from 'react-text-edit';

export default class MyComponent extends Component {

    constructor(props) {

        super(props);

        this.state = {
            data: ''
        };

        this.onChange = this::this.onChange;

    }

    onChange(data) {
        this.setState({
            data
        });
    }

    // ...

    render() {
        return (
            <ReactTextEdit data={this.state.data}
                           onChange={this.onChange}/>
        );
    }

}

Examples

Examples can be found in the examples folder.

Run Demo

$ npm run demo

License

This project is licensed under the terms of the MIT license