Skip to content

fatalxiao/react-text-edit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published