@@ -20,22 +20,23 @@ yarn add react-native-draftjs-render
2020```
2121
2222### Using
23- Just import and insert your Draft.js model on RNDraftJSRender :
23+ Just import and insert your Draft.js model on getRNDraftJSBlocks :
2424
2525``` js
2626import React from ' react' ;
2727import {
2828 AppRegistry ,
2929} from ' react-native' ;
3030
31- import RNDraftJSRender from ' react-native-draftjs-render' ;
31+ import getRNDraftJSBlocks from ' react-native-draftjs-render' ;
3232import contentState from ' DraftJs/contentState' ;
3333
34- const MyApp = () => (
35- < RNDraftJSRender
36- contentState= {contentState}
37- / >
38- );
34+ const MyApp = () => {
35+ const blocks = getRNDraftJSBlocks ({ contentState });
36+ return (
37+ < View style= {{ flex: 1 }}> {blocks}< / View>
38+ );
39+ };
3940
4041AppRegistry .registerComponent (' MyApp' , () => MyApp);
4142```
@@ -52,7 +53,7 @@ import {
5253 StyleSheet ,
5354} from ' react-native' ;
5455
55- import RNDraftJSRender from ' react-native-draftjs-render' ;
56+ import getRNDraftJSBlocks from ' react-native-draftjs-render' ;
5657import contentState from ' DraftJs/contentState' ;
5758
5859const styles = StyleSheet .flatten ({
@@ -66,19 +67,19 @@ const styles = StyleSheet.flatten({
6667 },
6768});
6869
69- const MyApp = () => (
70- < RNDraftJSRender
71- contentState = {contentState}
72- customStyles = {styles}
73- / >
74- ) ;
70+ const MyApp = () => {
71+ const blocks = getRNDraftJSBlocks ({ contentState, customStyles : styles });
72+ return (
73+ < View style = {{ flex : 1 }} > {blocks} < / View >
74+ );
75+ } ;
7576
7677AppRegistry .registerComponent (' MyApp' , () => MyApp);
7778```
7879
7980See more at ** [ Custom Styles] ( https://github.com/globocom/react-native-draftjs-render/blob/master/docs/CustomStyles.md ) ** documentation.
8081
81- ## Developing
82+ ## Contributing
8283
8384To develop using example react-native project:
8485
0 commit comments