From 68c05722b4a88866c67d30b158ccf37b12b0dd56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Huy=20Dang=20L=C3=AA-Ng=C3=B4?= Date: Wed, 19 Apr 2017 10:31:21 -0400 Subject: [PATCH] Use prop-types to access PropTypes --- package.json | 1 + src/__tests__/radium-test.js | 3 ++- src/components/style-root.js | 3 ++- src/components/style-sheet.js | 3 ++- src/components/style.js | 3 ++- src/enhancer.js | 3 ++- yarn.lock | 8 +++++++- 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 4e10a413..4fc499b8 100644 --- a/package.json +++ b/package.json @@ -85,6 +85,7 @@ "object-assign": "^4.1.1", "phantomjs-prebuilt": "^2.1.14", "prettier": "^0.22.0", + "prop-types": "^15.5.8", "react": "^15.4.2", "react-addons-test-utils": "^15.4.2", "react-dom": "^15.4.2", diff --git a/src/__tests__/radium-test.js b/src/__tests__/radium-test.js index a819c47a..ad52a35c 100644 --- a/src/__tests__/radium-test.js +++ b/src/__tests__/radium-test.js @@ -2,7 +2,8 @@ import Radium from 'index.js'; import MouseUpListener from 'plugins/mouse-up-listener.js'; -import React, {Component, PropTypes} from 'react'; +import React, {Component} from 'react'; +import PropTypes from 'prop-types'; import ReactDOM from 'react-dom'; import TestUtils from 'react-addons-test-utils'; import {getRenderOutput, getElement} from 'test-helpers'; diff --git a/src/components/style-root.js b/src/components/style-root.js index 4ca8d233..78910529 100644 --- a/src/components/style-root.js +++ b/src/components/style-root.js @@ -1,6 +1,7 @@ /* @flow */ -import React, {PureComponent, PropTypes} from 'react'; +import React, {PureComponent} from 'react'; +import PropTypes from 'prop-types'; import Enhancer from '../enhancer'; import StyleKeeper from '../style-keeper'; diff --git a/src/components/style-sheet.js b/src/components/style-sheet.js index ed32e76d..ad4aec6c 100644 --- a/src/components/style-sheet.js +++ b/src/components/style-sheet.js @@ -1,12 +1,13 @@ /* @flow */ import React, {PureComponent} from 'react'; +import PropTypes from 'prop-types'; import StyleKeeper from '../style-keeper'; export default class StyleSheet extends PureComponent { static contextTypes = { - _radiumStyleKeeper: React.PropTypes.instanceOf(StyleKeeper), + _radiumStyleKeeper: PropTypes.instanceOf(StyleKeeper), }; constructor() { diff --git a/src/components/style.js b/src/components/style.js index 58803d05..5b27fe49 100644 --- a/src/components/style.js +++ b/src/components/style.js @@ -2,7 +2,8 @@ import cssRuleSetToString from '../css-rule-set-to-string'; -import React, {PropTypes, PureComponent} from 'react'; +import React, {PureComponent} from 'react'; +import PropTypes from 'prop-types'; class Style extends PureComponent { static propTypes = { diff --git a/src/enhancer.js b/src/enhancer.js index 917b4510..d3635c0d 100644 --- a/src/enhancer.js +++ b/src/enhancer.js @@ -1,6 +1,7 @@ /* @flow */ -import {Component, PropTypes} from 'react'; +import {Component} from 'react'; +import PropTypes from 'prop-types'; import StyleKeeper from './style-keeper.js'; import resolveStyles from './resolve-styles.js'; diff --git a/yarn.lock b/yarn.lock index 8427402a..4362081f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2197,7 +2197,7 @@ faye-websocket@~0.11.0: dependencies: websocket-driver ">=0.5.1" -fbjs@^0.8.1, fbjs@^0.8.4: +fbjs@^0.8.1, fbjs@^0.8.4, fbjs@^0.8.9: version "0.8.12" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.12.tgz#10b5d92f76d45575fd63a217d4ea02bea2f8ed04" dependencies: @@ -4069,6 +4069,12 @@ promise@^7.1.1: dependencies: asap "~2.0.3" +prop-types@^15.5.8: + version "15.5.8" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.8.tgz#6b7b2e141083be38c8595aa51fc55775c7199394" + dependencies: + fbjs "^0.8.9" + proxy-addr@~1.1.3: version "1.1.4" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-1.1.4.tgz#27e545f6960a44a627d9b44467e35c1b6b4ce2f3"