Neo
Neo

Reputation: 21

What is a good text editing library for react-native?

I'm looking for a text editing library, but i can't find anything, maybe somebody with experience can help me.

I tried to use rich-editor but couldn't get it to work.

Please help, thanks in advance.

Upvotes: 2

Views: 3826

Answers (2)

btyx
btyx

Reputation: 21

You should definitely try this https://github.com/eneskarpuz/react-native-drag-text-editor You can ;

  • Add multiple text editors with different props
  • Edit & Type
  • Drag and Drop
  • Resize

Upvotes: 1

Dinesh Katwal
Dinesh Katwal

Reputation: 950

For React Native Application you can used react-native-wordpress-editor
Installing react-native-wordpress-editor

npm install react-native-wordpress-editor --save
or 
yarn add react-native-wordpress-editor

For more use this link
https://github.com/wix/react-native-wordpress-editor

For build rich text editor you can use draft.js build by facebook for react web application.

Install draft.js in our react application

npm install --save draft-js
or
yarn add draft-js

Simple Example of using draft.js in your project.

import React from 'react';
import ReactDOM from 'react-dom';
import {Editor, EditorState} from 'draft-js';

class MyEditor extends React.Component {
  constructor(props) {
    super(props);
    this.state = {editorState: EditorState.createEmpty()};
    this.onChange = (editorState) => this.setState({editorState});
  }
  render() {
    return (
      <Editor editorState={this.state.editorState} onChange={this.onChange} />
    );
  }
}

ReactDOM.render(
  <MyEditor />,
  document.getElementById('container')
);

Upvotes: 2

Related Questions