From 3214df7df41c34d0363e9c475cd3de898eb6b9e9 Mon Sep 17 00:00:00 2001 From: Ottis Kelleghan Date: Sun, 21 May 2017 16:44:05 +0100 Subject: [PATCH] Updating main.js and mixin.js to use the prop-types dependency instead of the one from the react package. This is because accessing PropTypes from the main React package is deprecated --- package.json | 3 ++- src/Mixin.js | 3 ++- src/main.js | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 225ce693..468e92f9 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ "react-component" ], "dependencies": { - "form-data-to-object": "^0.2.0" + "form-data-to-object": "^0.2.0", + "prop-types": "^15.5.10" }, "devDependencies": { "babel-cli": "^6.6.5", diff --git a/src/Mixin.js b/src/Mixin.js index d615fc7a..8bbffdef 100644 --- a/src/Mixin.js +++ b/src/Mixin.js @@ -1,5 +1,6 @@ var utils = require('./utils.js'); var React = global.React || require('react'); +var PropTypes = require('prop-types'); var convertValidationsToObject = function (validations) { @@ -44,7 +45,7 @@ module.exports = { }; }, contextTypes: { - formsy: React.PropTypes.object // What about required? + formsy: PropTypes.object // What about required? }, getDefaultProps: function () { return { diff --git a/src/main.js b/src/main.js index f7b5e8eb..8695a2ca 100644 --- a/src/main.js +++ b/src/main.js @@ -1,4 +1,5 @@ var React = global.React || require('react'); +var PropTypes = require('prop-types'); var Formsy = {}; var validationRules = require('./validationRules.js'); var formDataToObject = require('form-data-to-object'); @@ -46,7 +47,7 @@ Formsy.Form = React.createClass({ }, childContextTypes: { - formsy: React.PropTypes.object + formsy: PropTypes.object }, getChildContext: function () { return {