Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Commit

Permalink
Use prop-types package instead of React.PropTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
rgalus committed Apr 10, 2017
1 parent 81e367c commit e45513c
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 27 deletions.
3 changes: 2 additions & 1 deletion src/categories.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes, Component } from "react";
import React, { Component } from "react";
import PropTypes from "prop-types";
import { AutoSizer, List } from "react-virtualized";
import findIndex from "lodash/findIndex";
import throttle from "lodash/throttle";
Expand Down
3 changes: 2 additions & 1 deletion src/category-header.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes, Component } from "react";
import React, { Component } from "react";
import PropTypes from "prop-types";
import shallowCompare from "react-addons-shallow-compare";

export default class CategoryHeader extends Component {
Expand Down
3 changes: 2 additions & 1 deletion src/emoji-row.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from "react";
import React, { Component } from "react";
import PropTypes from "prop-types";
import shallowCompare from "react-addons-shallow-compare";
import Emoji from "./emoji";

Expand Down
13 changes: 7 additions & 6 deletions src/emoji.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import React, { Component } from "react";
import PropTypes from "prop-types";
import pick from "lodash/pick";
import emojione from "emojione";

export default class Emoji extends Component {
static propTypes = {
ariaLabel: React.PropTypes.string,
name: React.PropTypes.string,
onSelect: React.PropTypes.func.isRequired,
shortname: React.PropTypes.string,
title: React.PropTypes.string,
role: React.PropTypes.string
ariaLabel: PropTypes.string,
name: PropTypes.string,
onSelect: PropTypes.func.isRequired,
shortname: PropTypes.string,
title: PropTypes.string,
role: PropTypes.string
};

shouldComponentUpdate(nextProps) {
Expand Down
9 changes: 5 additions & 4 deletions src/modifier.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { Component } from "react";
import PropTypes from "prop-types";

export default class Modifier extends Component {
static propTypes = {
onClick: React.PropTypes.func.isRequired,
active: React.PropTypes.bool,
type: React.PropTypes.string.isRequired,
hex: React.PropTypes.string.isRequired
onClick: PropTypes.func.isRequired,
active: PropTypes.bool,
type: PropTypes.string.isRequired,
hex: PropTypes.string.isRequired
};

_handleClick = ev => {
Expand Down
7 changes: 4 additions & 3 deletions src/modifiers.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React, { Component } from "react";
import PropTypes from "prop-types";
import map from "lodash/map";
import Modifier from "./modifier";

export default class Modifiers extends Component {
static propTypes = {
onChange: React.PropTypes.func.isRequired,
modifiers: React.PropTypes.object,
active: React.PropTypes.string
onChange: PropTypes.func.isRequired,
modifiers: PropTypes.object,
active: PropTypes.string
};

static defaultProps = {
Expand Down
23 changes: 12 additions & 11 deletions src/picker.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component } from "react";
import PropTypes from "prop-types";
import emojione from "emojione";
import store from "store";
import each from "lodash/each";
Expand All @@ -13,19 +14,19 @@ import { defaultCategories } from "./constants";

export default class Picker extends Component {
static propTypes = {
emojione: React.PropTypes.shape({
imageType: React.PropTypes.string,
sprites: React.PropTypes.bool,
imagePathSVGSprites: React.PropTypes.string
emojione: PropTypes.shape({
imageType: PropTypes.string,
sprites: PropTypes.bool,
imagePathSVGSprites: PropTypes.string
}),
search: React.PropTypes.oneOfType([
React.PropTypes.bool,
React.PropTypes.string
search: PropTypes.oneOfType([
PropTypes.bool,
PropTypes.string
]),
searchPlaceholder: React.PropTypes.string,
className: React.PropTypes.string,
onChange: React.PropTypes.func.isRequired,
categories: React.PropTypes.object
searchPlaceholder: PropTypes.string,
className: PropTypes.string,
onChange: PropTypes.func.isRequired,
categories: PropTypes.object
};

static defaultProps = {
Expand Down

0 comments on commit e45513c

Please sign in to comment.