Skip to content

Commit

Permalink
update components from React.PropTypes to PropTypes package to avoid
Browse files Browse the repository at this point in the history
warning message
  • Loading branch information
nicksarafa committed May 5, 2017
1 parent 84e0f68 commit ed5a6f1
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 44 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"karma-jasmine": "^1.1.0",
"karma-webpack": "^2.0.2",
"mkdirp": "0.5.1",
"prop-types": "^15.5.8",
"react": "15.2.0",
"react-addons-test-utils": "15.2.0",
"react-dom": "15.2.0",
Expand Down
5 changes: 3 additions & 2 deletions src/components/anchors.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 InlineSVG from 'svg-inline-react'

import * as SVGs from '../svgs'
Expand Down Expand Up @@ -51,8 +52,8 @@ export default class Anchors extends React.Component {
}

Anchors.propTypes = {
categories: React.PropTypes.array,
onAnchorClick: React.PropTypes.func,
categories: PropTypes.array,
onAnchorClick: PropTypes.func,
}

Anchors.defaultProps = {
Expand Down
13 changes: 7 additions & 6 deletions src/components/category.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 frequently from '../utils/frequently'
import { Emoji } from '.'
Expand Down Expand Up @@ -154,12 +155,12 @@ export default class Category extends React.Component {
}

Category.propTypes = {
emojis: React.PropTypes.array,
hasStickyPosition: React.PropTypes.bool,
name: React.PropTypes.string.isRequired,
native: React.PropTypes.bool.isRequired,
perLine: React.PropTypes.number.isRequired,
emojiProps: React.PropTypes.object.isRequired,
emojis: PropTypes.array,
hasStickyPosition: PropTypes.bool,
name: PropTypes.string.isRequired,
native: PropTypes.bool.isRequired,
perLine: PropTypes.number.isRequired,
emojiProps: PropTypes.object.isRequired,
}

Category.defaultProps = {
Expand Down
27 changes: 14 additions & 13 deletions src/components/emoji.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 data from '../../data'

import { getData, getSanitizedData, unifiedToNative } from '../utils'
Expand Down Expand Up @@ -104,19 +105,19 @@ export default class Emoji extends React.Component {
}

Emoji.propTypes = {
onOver: React.PropTypes.func,
onLeave: React.PropTypes.func,
onClick: React.PropTypes.func,
backgroundImageFn: React.PropTypes.func,
native: React.PropTypes.bool,
forceSize: React.PropTypes.bool,
skin: React.PropTypes.oneOf([1, 2, 3, 4, 5, 6]),
sheetSize: React.PropTypes.oneOf([16, 20, 32, 64]),
set: React.PropTypes.oneOf(['apple', 'google', 'twitter', 'emojione']),
size: React.PropTypes.number.isRequired,
emoji: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.object,
onOver: PropTypes.func,
onLeave: PropTypes.func,
onClick: PropTypes.func,
backgroundImageFn: PropTypes.func,
native: PropTypes.bool,
forceSize: PropTypes.bool,
skin: PropTypes.oneOf([1, 2, 3, 4, 5, 6]),
sheetSize: PropTypes.oneOf([16, 20, 32, 64]),
set: PropTypes.oneOf(['apple', 'google', 'twitter', 'emojione']),
size: PropTypes.number.isRequired,
emoji: PropTypes.oneOfType([
PropTypes.string,
PropTypes.object,
]).isRequired,
}

Expand Down
27 changes: 14 additions & 13 deletions src/components/picker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import '../vendor/raf-polyfill'

import React from 'react'
import PropTypes from 'prop-types'
import data from '../../data'

import store from '../utils/store'
Expand Down Expand Up @@ -368,23 +369,23 @@ export default class Picker extends React.Component {
}

Picker.propTypes = {
onClick: React.PropTypes.func,
perLine: React.PropTypes.number,
emojiSize: React.PropTypes.number,
i18n: React.PropTypes.object,
style: React.PropTypes.object,
title: React.PropTypes.string,
emoji: React.PropTypes.string,
color: React.PropTypes.string,
onClick: PropTypes.func,
perLine: PropTypes.number,
emojiSize: PropTypes.number,
i18n: PropTypes.object,
style: PropTypes.object,
title: PropTypes.string,
emoji: PropTypes.string,
color: PropTypes.string,
set: Emoji.propTypes.set,
skin: Emoji.propTypes.skin,
native: React.PropTypes.bool,
native: PropTypes.bool,
backgroundImageFn: Emoji.propTypes.backgroundImageFn,
sheetSize: Emoji.propTypes.sheetSize,
emojisToShowFilter: React.PropTypes.func,
include: React.PropTypes.arrayOf(React.PropTypes.string),
exclude: React.PropTypes.arrayOf(React.PropTypes.string),
autoFocus: React.PropTypes.bool,
emojisToShowFilter: PropTypes.func,
include: PropTypes.arrayOf(PropTypes.string),
exclude: PropTypes.arrayOf(PropTypes.string),
autoFocus: PropTypes.bool,
}

Picker.defaultProps = {
Expand Down
9 changes: 5 additions & 4 deletions src/components/preview.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 { Emoji, Skins } from '.'
import { getData } from '../utils'
Expand Down Expand Up @@ -75,8 +76,8 @@ export default class Preview extends React.Component {
}

Preview.propTypes = {
title: React.PropTypes.string.isRequired,
emoji: React.PropTypes.string.isRequired,
emojiProps: React.PropTypes.object.isRequired,
skinsProps: React.PropTypes.object.isRequired,
title: PropTypes.string.isRequired,
emoji: PropTypes.string.isRequired,
emojiProps: PropTypes.object.isRequired,
skinsProps: PropTypes.object.isRequired,
}
9 changes: 5 additions & 4 deletions src/components/search.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 emojiIndex from '../utils/emoji-index'

export default class Search extends React.Component {
Expand Down Expand Up @@ -33,10 +34,10 @@ export default class Search extends React.Component {
}

Search.propTypes = {
onSearch: React.PropTypes.func,
maxResults: React.PropTypes.number,
emojisToShowFilter: React.PropTypes.func,
autoFocus: React.PropTypes.bool,
onSearch: PropTypes.func,
maxResults: PropTypes.number,
emojisToShowFilter: PropTypes.func,
autoFocus: PropTypes.bool,
}

Search.defaultProps = {
Expand Down
5 changes: 3 additions & 2 deletions src/components/skins.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import PropTypes from 'prop-types'

export default class Skins extends React.Component {
constructor(props) {
Expand Down Expand Up @@ -43,8 +44,8 @@ export default class Skins extends React.Component {
}

Skins.propTypes = {
onChange: React.PropTypes.func,
skin: React.PropTypes.number.isRequired,
onChange: PropTypes.func,
skin: PropTypes.number.isRequired,
}

Skins.defaultProps = {
Expand Down

0 comments on commit ed5a6f1

Please sign in to comment.