From 93426a7f57031682dc2a22215f10c3260d6b60b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Huy=20Dang=20L=C3=AA-Ng=C3=B4?= Date: Wed, 19 Apr 2017 11:10:47 -0400 Subject: [PATCH] Fix deprecation warnings --- package.json | 4 +++- src/Component.js | 16 +++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index da32036..deb21b6 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,9 @@ "react": "^0.14 || ^15" }, "dependencies": { - "copy-to-clipboard": "^3" + "copy-to-clipboard": "^3", + "create-react-class": "^15.5.2", + "prop-types": "^15.5.8" }, "devDependencies": { "copy-to-clipboard": "3.0.5", diff --git a/src/Component.js b/src/Component.js index a876575..ccdf8ef 100644 --- a/src/Component.js +++ b/src/Component.js @@ -1,15 +1,17 @@ import React from 'react'; +import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; import copy from 'copy-to-clipboard'; -export const CopyToClipboard = React.createClass({ +export const CopyToClipboard = createReactClass({ propTypes: { - text: React.PropTypes.string.isRequired, - children: React.PropTypes.element.isRequired, - onCopy: React.PropTypes.func, - options: React.PropTypes.shape({ - debug: React.PropTypes.bool, - message: React.PropTypes.string + text: PropTypes.string.isRequired, + children: PropTypes.element.isRequired, + onCopy: PropTypes.func, + options: PropTypes.shape({ + debug: PropTypes.bool, + message: PropTypes.string }) },