React Native render for draft.js model
npm install react-native-draftjs-render



A React Native render for Draft.js model.
Join the #react-native-render channel on DraftJS Slack team.
* Get Started
* Add Custom Styles
* Handle Atomic Types
``sh`
yarn add react-native-draftjs-renderor...
npm i -S react-native-draftjs-render
`js
import React from 'react';
import {
ScrollView,
AppRegistry,
} from 'react-native';
import getRNDraftJSBlocks from 'react-native-draftjs-render';
import contentState from 'DraftJs/contentState';
const MyApp = () => {
const blocks = getRNDraftJSBlocks({ contentState });
return (
);
};
AppRegistry.registerComponent('MyApp', () => MyApp);
`
See our sample folder for more details.
`js
import React from 'react';
import {
AppRegistry,
ScrollView,
StyleSheet,
} from 'react-native';
import getRNDraftJSBlocks from 'react-native-draftjs-render';
import contentState from 'DraftJs/contentState';
const styles = StyleSheet.flatten({
paragraph: {
color: 'pink',
fontSize: 18,
},
link: {
color: 'blue',
fontWeight: 'bold',
},
});
const MyApp = () => {
const blocks = getRNDraftJSBlocks({ contentState, customStyles: styles });
return (
);
};
AppRegistry.registerComponent('MyApp', () => MyApp);
`
See more at Custom Styles documentation.
To develop using example react-native project:
``
git clone git@github.com:globocom/react-native-draftjs-render.git
cd react-native-draftjs-render/
make setup
To run tests:
``
make test
To watch lib changes appearing on Sample App:
``
make watch
To run sample app in iOS:
``
make ios
To run sample app in Android:
```
make android