Skip to content

Commit

Permalink
add prop-types for RN49 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Lu committed Jan 15, 2018
1 parent c3d44d2 commit 97ed9c9
Show file tree
Hide file tree
Showing 4 changed files with 1,804 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules
/coverage
*.log
.idea
18 changes: 12 additions & 6 deletions lib/MarkdownView.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component,} from 'react';
import PropTypes from 'prop-types';
import { View, Text, WebView, StyleSheet, Linking } from 'react-native';
import showdown from 'showdown';

Expand Down Expand Up @@ -65,13 +66,18 @@ class MarkdownView extends Component {
}
}

const stylesheetProp = PropTypes.oneOfType([
PropTypes.number,
PropTypes.object,
]);

MarkdownView.propTypes = {
title: React.PropTypes.string,
body: React.PropTypes.string.isRequired,
pureCSS: React.PropTypes.string,
options: React.PropTypes.object,
automaticallyAdjustContentInsets: React.PropTypes.bool,
style: View.propTypes.style,
title: PropTypes.string,
body: PropTypes.string.isRequired,
pureCSS: PropTypes.string,
options: PropTypes.object,
automaticallyAdjustContentInsets: PropTypes.bool,
style: stylesheetProp,
};

MarkdownView.defaultProps = {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"showdown"
],
"dependencies": {
"prop-types": "^15.6.0",
"showdown": "^1.3.0"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 97ed9c9

Please sign in to comment.