Skip to content

Commit c6dd684

Browse files
committed
adding styles to root style to markdown renderer #50
1 parent 8b16904 commit c6dd684

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/lib/AstRenderer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import React, { Component, PropTypes } from "react";
22
import { Text, View } from "react-native";
33
import getUniqueID from "./util/getUniqueID";
44

5-
export function rootRenderRule(children) {
6-
return <View key={getUniqueID()}>{children}</View>;
5+
export function rootRenderRule(children, styles) {
6+
return <View key={getUniqueID()} styles={styles.root}>{children}</View>;
77
}
88

99
/**
@@ -66,6 +66,6 @@ export default class AstRenderer {
6666
*/
6767
render = nodes => {
6868
const children = nodes.map(value => this.renderNode(value, []));
69-
return rootRenderRule(children);
69+
return rootRenderRule(children, this._style);
7070
};
7171
}

src/lib/styles.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import PlatformEnum from './data/PlatformEnum';
55
*
66
*/
77
export const styles = StyleSheet.create({
8+
root: {},
89
view: {},
910
codeBlock: {
1011
borderWidth: 1,

0 commit comments

Comments
 (0)