From a7c93e25adad754128d41726d40d6b10e969439d Mon Sep 17 00:00:00 2001 From: Aaron Dancer Date: Wed, 15 Nov 2017 17:28:41 -0600 Subject: [PATCH] Update code for React v16 compatibility (#115) --- GiftedForm.js | 18 +++-- README.md | 2 +- mixins/ContainerMixin.js | 9 ++- mixins/WidgetMixin.js | 29 ++++--- package.json | 12 +-- widgets/DatePickerIOSWidget.js | 9 ++- widgets/ErrorsWidget.js | 3 +- widgets/GooglePlacesWidget.js | 5 +- widgets/GroupWidget.js | 3 +- widgets/HiddenWidget.js | 9 ++- widgets/LoadingWidget.js | 9 ++- widgets/ModalWidget.js | 16 ++-- widgets/NoticeWidget.js | 9 ++- widgets/OptionWidget.js | 9 ++- widgets/RowValueWidget.js | 9 ++- widgets/RowWidget.js | 9 ++- widgets/SelectCountryWidget.js | 9 ++- widgets/SelectWidget.js | 3 +- widgets/SeparatorWidget.js | 9 ++- widgets/SubmitWidget.js | 18 +++-- widgets/SwitchWidget.js | 11 +-- widgets/TextAreaWidget.js | 9 ++- widgets/TextInputWidget.js | 9 ++- widgets/ValidationErrorWidget.js | 9 ++- yarn.lock | 130 +++++++++++++++++++++++++++---- 25 files changed, 246 insertions(+), 121 deletions(-) diff --git a/GiftedForm.js b/GiftedForm.js index c958453..724b33c 100644 --- a/GiftedForm.js +++ b/GiftedForm.js @@ -1,4 +1,6 @@ import React from 'react'; +import PropTypes from 'prop-types'; +import createReactClass from 'create-react-class'; const GiftedFormManager = require('./GiftedFormManager'); @@ -25,7 +27,7 @@ const LoadingWidget = require('./widgets/LoadingWidget'); const HiddenWidget = require('./widgets/HiddenWidget'); const ErrorsWidget = require('./widgets/ErrorsWidget'); -const GiftedForm = React.createClass({ +const GiftedForm = createReactClass({ mixins: [ ContainerMixin ], statics: { @@ -62,11 +64,11 @@ const GiftedForm = React.createClass({ }, propTypes: { - isModal: React.PropTypes.bool, - clearOnClose: React.PropTypes.bool, - validators: React.PropTypes.object, - defaults: React.PropTypes.object, - openModal: React.PropTypes.func, + isModal: PropTypes.bool, + clearOnClose: PropTypes.bool, + validators: PropTypes.object, + defaults: PropTypes.object, + openModal: PropTypes.func, }, componentWillUnmount() { @@ -96,7 +98,7 @@ const GiftedForm = React.createClass({ }, }); -var GiftedFormModal = React.createClass({ +var GiftedFormModal = createReactClass({ mixins: [ ContainerMixin ], getDefaultProps() { @@ -106,7 +108,7 @@ var GiftedFormModal = React.createClass({ }, propTypes: { - isModal: React.PropTypes.bool, + isModal: PropTypes.bool, }, render() { diff --git a/README.md b/README.md index 4224bbc..20a2508 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Form component for React Native. ```js var { GiftedForm, GiftedFormManager } = require('react-native-gifted-form'); -var FormComponent = React.createClass({ +var FormComponent = createReactClass({ render() { return ( =0.10.0" + +js-tokens@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" lodash.debounce@^4.0.8: version "4.0.8" @@ -16,33 +70,79 @@ lodash.isequal@^4.1.4: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" -moment@~2.18.1: - version "2.18.1" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.18.1.tgz#c36193dd3ce1c2eed2adb7c802dbbc77a81b1c0f" +loose-envify@^1.0.0, loose-envify@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + dependencies: + js-tokens "^3.0.0" + +moment@^2.19.1: + version "2.19.1" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.19.1.tgz#56da1a2d1cbf01d38b7e1afc31c10bcfa1929167" + +node-fetch@^1.0.1: + version "1.7.3" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" + dependencies: + encoding "^0.1.11" + is-stream "^1.0.1" + +object-assign@^4.1.0, object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +promise@^7.1.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" + dependencies: + asap "~2.0.3" + +prop-types@^15.5.10, prop-types@^15.6.0: + version "15.6.0" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856" + dependencies: + fbjs "^0.8.16" + loose-envify "^1.3.1" + object-assign "^4.1.1" qs@^5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/qs/-/qs-5.2.1.tgz#801fee030e0b9450d6385adc48a4cc55b44aedfc" -react-native-button@~1.8.2: - version "1.8.2" - resolved "https://registry.yarnpkg.com/react-native-button/-/react-native-button-1.8.2.tgz#49e5cadd22ee443adea52a85539d288aa2117ade" +react-native-button@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/react-native-button/-/react-native-button-2.1.0.tgz#a39e23292922afeea4f7be141dd43e18f1b51876" + dependencies: + prop-types "^15.5.10" react-native-gifted-spinner@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/react-native-gifted-spinner/-/react-native-gifted-spinner-0.1.0.tgz#2c76094fa0469c59e96dead270cd5bca5a55962a" -react-native-google-places-autocomplete@~1.2.0: - version "1.2.12" - resolved "https://registry.yarnpkg.com/react-native-google-places-autocomplete/-/react-native-google-places-autocomplete-1.2.12.tgz#714c731be35bfca190239d98cbc7e0d518b38d98" +react-native-google-places-autocomplete@^1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/react-native-google-places-autocomplete/-/react-native-google-places-autocomplete-1.3.6.tgz#352ba0858f647c0c2caba448b6b6296984d8c7af" dependencies: lodash.debounce "^4.0.8" + prop-types "^15.5.10" qs "^5.2.0" react-timer-mixin@~0.13.3: version "0.13.3" resolved "https://registry.yarnpkg.com/react-timer-mixin/-/react-timer-mixin-0.13.3.tgz#0da8b9f807ec07dc3e854d082c737c65605b3d22" -validator@~7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/validator/-/validator-7.1.0.tgz#331695afc7e6d72f980bddd68aa296d6b3d6c8b6" +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + +ua-parser-js@^0.7.9: + version "0.7.17" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac" + +validator@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/validator/-/validator-9.0.0.tgz#6c1ef955e007af704adea86ae8a76da84a6c172e" + +whatwg-fetch@>=0.10.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"