Merge pull request #74 from nsarafa/hotfix/prop-types [Fix #65]

update components from React.PropTypes to PropTypes package
release
Etienne Lemay 2017-05-17 09:18:45 -04:00 committed by GitHub
commit 3a6189f91d
8 changed files with 52 additions and 44 deletions

View File

@ -39,6 +39,7 @@
"karma-jasmine": "^1.1.0", "karma-jasmine": "^1.1.0",
"karma-webpack": "^2.0.2", "karma-webpack": "^2.0.2",
"mkdirp": "0.5.1", "mkdirp": "0.5.1",
"prop-types": "^15.5.8",
"react": "15.2.0", "react": "15.2.0",
"react-addons-test-utils": "15.2.0", "react-addons-test-utils": "15.2.0",
"react-dom": "15.2.0", "react-dom": "15.2.0",

View File

@ -1,4 +1,5 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types'
import InlineSVG from 'svg-inline-react' import InlineSVG from 'svg-inline-react'
import * as SVGs from '../svgs' import * as SVGs from '../svgs'
@ -51,8 +52,8 @@ export default class Anchors extends React.Component {
} }
Anchors.propTypes = { Anchors.propTypes = {
categories: React.PropTypes.array, categories: PropTypes.array,
onAnchorClick: React.PropTypes.func, onAnchorClick: PropTypes.func,
} }
Anchors.defaultProps = { Anchors.defaultProps = {

View File

@ -1,4 +1,5 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types'
import frequently from '../utils/frequently' import frequently from '../utils/frequently'
import { Emoji } from '.' import { Emoji } from '.'
@ -154,12 +155,12 @@ export default class Category extends React.Component {
} }
Category.propTypes = { Category.propTypes = {
emojis: React.PropTypes.array, emojis: PropTypes.array,
hasStickyPosition: React.PropTypes.bool, hasStickyPosition: PropTypes.bool,
name: React.PropTypes.string.isRequired, name: PropTypes.string.isRequired,
native: React.PropTypes.bool.isRequired, native: PropTypes.bool.isRequired,
perLine: React.PropTypes.number.isRequired, perLine: PropTypes.number.isRequired,
emojiProps: React.PropTypes.object.isRequired, emojiProps: PropTypes.object.isRequired,
} }
Category.defaultProps = { Category.defaultProps = {

View File

@ -1,4 +1,5 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types'
import data from '../../data' import data from '../../data'
import { getData, getSanitizedData, unifiedToNative } from '../utils' import { getData, getSanitizedData, unifiedToNative } from '../utils'
@ -104,19 +105,19 @@ export default class Emoji extends React.Component {
} }
Emoji.propTypes = { Emoji.propTypes = {
onOver: React.PropTypes.func, onOver: PropTypes.func,
onLeave: React.PropTypes.func, onLeave: PropTypes.func,
onClick: React.PropTypes.func, onClick: PropTypes.func,
backgroundImageFn: React.PropTypes.func, backgroundImageFn: PropTypes.func,
native: React.PropTypes.bool, native: PropTypes.bool,
forceSize: React.PropTypes.bool, forceSize: PropTypes.bool,
skin: React.PropTypes.oneOf([1, 2, 3, 4, 5, 6]), skin: PropTypes.oneOf([1, 2, 3, 4, 5, 6]),
sheetSize: React.PropTypes.oneOf([16, 20, 32, 64]), sheetSize: PropTypes.oneOf([16, 20, 32, 64]),
set: React.PropTypes.oneOf(['apple', 'google', 'twitter', 'emojione']), set: PropTypes.oneOf(['apple', 'google', 'twitter', 'emojione']),
size: React.PropTypes.number.isRequired, size: PropTypes.number.isRequired,
emoji: React.PropTypes.oneOfType([ emoji: PropTypes.oneOfType([
React.PropTypes.string, PropTypes.string,
React.PropTypes.object, PropTypes.object,
]).isRequired, ]).isRequired,
} }

View File

@ -1,6 +1,7 @@
import '../vendor/raf-polyfill' import '../vendor/raf-polyfill'
import React from 'react' import React from 'react'
import PropTypes from 'prop-types'
import data from '../../data' import data from '../../data'
import store from '../utils/store' import store from '../utils/store'
@ -368,23 +369,23 @@ export default class Picker extends React.Component {
} }
Picker.propTypes = { Picker.propTypes = {
onClick: React.PropTypes.func, onClick: PropTypes.func,
perLine: React.PropTypes.number, perLine: PropTypes.number,
emojiSize: React.PropTypes.number, emojiSize: PropTypes.number,
i18n: React.PropTypes.object, i18n: PropTypes.object,
style: React.PropTypes.object, style: PropTypes.object,
title: React.PropTypes.string, title: PropTypes.string,
emoji: React.PropTypes.string, emoji: PropTypes.string,
color: React.PropTypes.string, color: PropTypes.string,
set: Emoji.propTypes.set, set: Emoji.propTypes.set,
skin: Emoji.propTypes.skin, skin: Emoji.propTypes.skin,
native: React.PropTypes.bool, native: PropTypes.bool,
backgroundImageFn: Emoji.propTypes.backgroundImageFn, backgroundImageFn: Emoji.propTypes.backgroundImageFn,
sheetSize: Emoji.propTypes.sheetSize, sheetSize: Emoji.propTypes.sheetSize,
emojisToShowFilter: React.PropTypes.func, emojisToShowFilter: PropTypes.func,
include: React.PropTypes.arrayOf(React.PropTypes.string), include: PropTypes.arrayOf(PropTypes.string),
exclude: React.PropTypes.arrayOf(React.PropTypes.string), exclude: PropTypes.arrayOf(PropTypes.string),
autoFocus: React.PropTypes.bool, autoFocus: PropTypes.bool,
} }
Picker.defaultProps = { Picker.defaultProps = {

View File

@ -1,4 +1,5 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types'
import { Emoji, Skins } from '.' import { Emoji, Skins } from '.'
import { getData } from '../utils' import { getData } from '../utils'
@ -75,8 +76,8 @@ export default class Preview extends React.Component {
} }
Preview.propTypes = { Preview.propTypes = {
title: React.PropTypes.string.isRequired, title: PropTypes.string.isRequired,
emoji: React.PropTypes.string.isRequired, emoji: PropTypes.string.isRequired,
emojiProps: React.PropTypes.object.isRequired, emojiProps: PropTypes.object.isRequired,
skinsProps: React.PropTypes.object.isRequired, skinsProps: PropTypes.object.isRequired,
} }

View File

@ -1,4 +1,5 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types'
import emojiIndex from '../utils/emoji-index' import emojiIndex from '../utils/emoji-index'
export default class Search extends React.Component { export default class Search extends React.Component {
@ -33,10 +34,10 @@ export default class Search extends React.Component {
} }
Search.propTypes = { Search.propTypes = {
onSearch: React.PropTypes.func, onSearch: PropTypes.func,
maxResults: React.PropTypes.number, maxResults: PropTypes.number,
emojisToShowFilter: React.PropTypes.func, emojisToShowFilter: PropTypes.func,
autoFocus: React.PropTypes.bool, autoFocus: PropTypes.bool,
} }
Search.defaultProps = { Search.defaultProps = {

View File

@ -1,4 +1,5 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types'
export default class Skins extends React.Component { export default class Skins extends React.Component {
constructor(props) { constructor(props) {
@ -43,8 +44,8 @@ export default class Skins extends React.Component {
} }
Skins.propTypes = { Skins.propTypes = {
onChange: React.PropTypes.func, onChange: PropTypes.func,
skin: React.PropTypes.number.isRequired, skin: PropTypes.number.isRequired,
} }
Skins.defaultProps = { Skins.defaultProps = {