react-text-edit

0.2.3 • Public • Published

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

Package Sidebar

Install

npm i react-text-edit

Weekly Downloads

1

Version

0.2.3

License

MIT

Last publish

Collaborators

  • fatalxiao