Skip to content

Commit

Permalink
Merge pull request #3 from udovenko/fix-react-proptypes-warnings
Browse files Browse the repository at this point in the history
Fix React PropTypes warnings
  • Loading branch information
madox2 authored Apr 18, 2017
2 parents cfb414e + 4a07bf2 commit 15ca48a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 19 deletions.
2 changes: 1 addition & 1 deletion __tests__/TagCloud-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jest.mock('array-shuffle', () => arr => arr.slice().reverse());

import React from 'react';
import ReactDOM from 'react-dom';
import TestUtils from 'react-addons-test-utils';
import TestUtils from 'react-dom/test-utils';
import { TagCloud } from '../src/TagCloud';

const { createSpy, any } = jasmine;
Expand Down
2 changes: 1 addition & 1 deletion __tests__/defaultRenderer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jest.unmock('../src/helpers');

jest.mock('randomcolor', () => o => Object.keys(o).length ? 'custom' : 'red');

import TestUtils from 'react-addons-test-utils';
import TestUtils from 'react-dom/test-utils';
import { defaultRenderer } from '../src/defaultRenderer';

const { any, objectContaining } = jasmine;
Expand Down
20 changes: 12 additions & 8 deletions lib/TagCloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _defaultRenderer = require('./defaultRenderer');

var _arrayShuffle = require('array-shuffle');
Expand Down Expand Up @@ -134,14 +138,14 @@ var TagCloud = exports.TagCloud = function (_React$Component) {
}(_react2.default.Component);

TagCloud.propTypes = {
tags: _react2.default.PropTypes.array.isRequired,
maxSize: _react2.default.PropTypes.number.isRequired,
minSize: _react2.default.PropTypes.number.isRequired,
shuffle: _react2.default.PropTypes.bool,
colorOptions: _react2.default.PropTypes.object,
disableRandomColor: _react2.default.PropTypes.bool,
renderer: _react2.default.PropTypes.func,
className: _react2.default.PropTypes.string
tags: _propTypes2.default.array.isRequired,
maxSize: _propTypes2.default.number.isRequired,
minSize: _propTypes2.default.number.isRequired,
shuffle: _propTypes2.default.bool,
colorOptions: _propTypes2.default.object,
disableRandomColor: _propTypes2.default.bool,
renderer: _propTypes2.default.func,
className: _propTypes2.default.string
};

TagCloud.defaultProps = {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-tagcloud",
"version": "1.1.0",
"version": "1.2.0",
"description": "Tag/word cloud component for react",
"main": "lib/index.js",
"scripts": {
Expand Down Expand Up @@ -31,6 +31,7 @@
"dependencies": {
"array-shuffle": "^1.0.0",
"object-assign": "^4.1.0",
"prop-types": "^15.5.8",
"randomcolor": "^0.4.2"
},
"devDependencies": {
Expand Down
17 changes: 9 additions & 8 deletions src/TagCloud.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import { defaultRenderer } from './defaultRenderer';
import arrayShuffle from 'array-shuffle';
import randomColor from 'randomcolor';
Expand Down Expand Up @@ -73,14 +74,14 @@ export class TagCloud extends React.Component {
}

TagCloud.propTypes = {
tags: React.PropTypes.array.isRequired,
maxSize: React.PropTypes.number.isRequired,
minSize: React.PropTypes.number.isRequired,
shuffle: React.PropTypes.bool,
colorOptions: React.PropTypes.object,
disableRandomColor: React.PropTypes.bool,
renderer: React.PropTypes.func,
className: React.PropTypes.string
tags: PropTypes.array.isRequired,
maxSize: PropTypes.number.isRequired,
minSize: PropTypes.number.isRequired,
shuffle: PropTypes.bool,
colorOptions: PropTypes.object,
disableRandomColor: PropTypes.bool,
renderer: PropTypes.func,
className: PropTypes.string
};

TagCloud.defaultProps = {
Expand Down

0 comments on commit 15ca48a

Please sign in to comment.