react-native-draftjs-renderer
Version:
React Native render for draft.js and react-draft-wysiwyg
48 lines (37 loc) • 1.13 kB
Markdown
A React Native render for [Draft.js](http://draftjs.org/) model and works great with [react-draft-wysiwyg](https://github.com/jpuri/react-draft-wysiwyg).
Install **React Native Draft.js Render** on your React Native project, using NPM or Yarn:
```sh
npm i -S react-native-draftjs-renderer
yarn add react-native-draftjs-renderer
```
Just import and insert your Draft.js model on RNDraftJSRender:
```js
import React from 'react';
import {
AppRegistry,
} from 'react-native';
import RNDraftJSRender from 'react-native-draftjs-renderer';
import contentState from 'DraftJs/contentState';
const MyApp = () => (
<RNDraftJSRender
contentState={contentState}
/>
);
AppRegistry.registerComponent('MyApp', () => MyApp);
```
TODO:
* [Android] Justify text content support.
UPDATE:
* Minor style change.
* Remove dynamic Image height support, which will cause image blink.
* Fix the image auto height crop problem.
* Fix fontSize can not be over 14 bug.
* Increase the Text padding size to 2.
* Add dynamic Image height support.