From 370376b10992fe81f6b1348bea39f3a8b8b2ef4f Mon Sep 17 00:00:00 2001 From: Arseni Buinitski Date: Tue, 24 Oct 2017 01:52:39 +0300 Subject: [PATCH] Added support for React 16 --- .gitignore | 3 +++ README.md | 6 ++++++ lib/FloatingLabel.js | 3 ++- lib/TextField.js | 3 ++- lib/Underline.js | 3 ++- package.json | 7 +++++-- 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 9fbb23c..bcc7662 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,6 @@ npm-debug.log # examples examples/FloatingLabel/node_modules/ examples/FloatingLabel/lib/ + +# JetBrains IDEs +.idea \ No newline at end of file diff --git a/README.md b/README.md index 781eca4..865bb53 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,12 @@ React Native TextInput styled with Material Design. npm install react-native-md-textinput ``` +#### Supporting older versions of react-native +| RN version | Library Version | +|------------|-----------------| +| \>= 0.46 | \>= 2.1.0 | +| < 0.46 | 2.0.4 | + ## Usage I'm going to refer to the `react-native-md-textinput` Component as `TextField`. You can name it whatever you like when importing it. diff --git a/lib/FloatingLabel.js b/lib/FloatingLabel.js index 5f96eab..8a7b224 100644 --- a/lib/FloatingLabel.js +++ b/lib/FloatingLabel.js @@ -1,5 +1,6 @@ 'use strict'; -import React, {Component, PropTypes} from "react"; +import React, {Component} from "react"; +import PropTypes from "prop-types"; import {StyleSheet, Animated} from "react-native"; export default class FloatingLabel extends Component { diff --git a/lib/TextField.js b/lib/TextField.js index d42523a..90d6d59 100644 --- a/lib/TextField.js +++ b/lib/TextField.js @@ -1,5 +1,6 @@ 'use strict'; -import React, {Component, PropTypes} from "react"; +import React, {Component} from "react"; +import PropTypes from "prop-types"; import {View, TextInput, StyleSheet} from "react-native"; import Underline from './Underline'; diff --git a/lib/Underline.js b/lib/Underline.js index 4368733..664e17e 100644 --- a/lib/Underline.js +++ b/lib/Underline.js @@ -1,5 +1,6 @@ 'use strict'; -import React, {Component, PropTypes} from "react"; +import React, {Component} from "react"; +import PropTypes from "prop-types"; import {View, StyleSheet, Animated} from "react-native"; export default class Underline extends Component { diff --git a/package.json b/package.json index f17e6b5..c8e4a5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-md-textinput", - "version": "2.0.4", + "version": "2.1.0", "description": "React Native TextInput styled with Material Design.", "main": "lib/TextField.js", "repository": { @@ -19,5 +19,8 @@ }, "author": "Evan Johnson", "license": "MIT", - "homepage": "https://github.com/evblurbs/react-native-md-textinput#readme" + "homepage": "https://github.com/evblurbs/react-native-md-textinput#readme", + "peerDependencies": { + "react-native": ">=0.46.0" + } }