diff --git a/index.android.js b/index.android.js index 59bdfed..279118b 100644 --- a/index.android.js +++ b/index.android.js @@ -1,6 +1,6 @@ // @flow - -import React, { Component, PropTypes } from 'react'; +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import { processColor, requireNativeComponent, PointPropType, StyleSheet, View, ViewPropTypes } from 'react-native'; const deprecatedPropType = require('react-native/Libraries/Utilities/deprecatedPropType.js'); diff --git a/index.ios.js b/index.ios.js index 092a177..bf387ff 100644 --- a/index.ios.js +++ b/index.ios.js @@ -2,7 +2,8 @@ * @providesModule LinearGradient * @flow */ -import React, { Component, PropTypes } from 'react'; +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import { processColor, requireNativeComponent, PointPropType, View, ViewPropTypes } from 'react-native'; const deprecatedPropType = require('react-native/Libraries/Utilities/deprecatedPropType.js'); diff --git a/index.js b/index.js new file mode 100644 index 0000000..e4ca903 --- /dev/null +++ b/index.js @@ -0,0 +1,9 @@ +import { Platform } from "react-native"; +import LinearGradientIos from "./index.ios.js"; +import LinearGradientAndroid from "./index.android.js"; + +const LinearGradient = Platform.OS === "ios" + ? LinearGradientIos + : LinearGradientAndroid; + +export default LinearGradient; diff --git a/package.json b/package.json index 6a83804..7db8806 100644 --- a/package.json +++ b/package.json @@ -24,5 +24,8 @@ }, "devDependencies": { "jest-cli": "0.2.1" + }, + "dependencies": { + "prop-types": "^15.5.10" } }