Skip to content

Commit 07c1315

Browse files
author
Raphael Freitas
committed
Update docs to use StyleSheet.flatten for custom styles
1 parent a18803b commit 07c1315

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import {
5555
import RNDraftJSRender from 'react-native-draftjs-render';
5656
import contentState from 'DraftJs/contentState';
5757

58-
const styles = StyleSheet.create({
58+
const styles = StyleSheet.flatten({
5959
paragraph: {
6060
color: 'pink',
6161
fontSize: 18,

docs/CustomStyles.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import RNDraftJSRender from 'react-native-draftjs-render';
1212
import contentState from 'DraftJs/contentState';
1313

14-
const styles = StyleSheet.create({
14+
const styles = StyleSheet.flatten({ // Use .flatten over .create
1515
'header-one': {
1616
fontSize: 20,
1717
},

sample/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const styles = StyleSheet.create({
2626
},
2727
});
2828

29-
const customStyles = {
29+
const customStyles = StyleSheet.flatten({
3030
unstyled: {
3131
fontSize: 18,
3232
fontWeight: 'normal',
@@ -88,7 +88,7 @@ const customStyles = {
8888
viewAfterList: {
8989
marginBottom: 32,
9090
},
91-
};
91+
});
9292

9393
const atomicHandler = (item: Object): any => {
9494
switch (item.data.type) {

0 commit comments

Comments
 (0)