class-methods-use-this

This commit is contained in:
Amine Ben hammou
2017-10-31 16:46:19 +00:00
parent d791538086
commit 588ad3eab7
2 changed files with 2 additions and 5 deletions

View File

@@ -49,7 +49,7 @@ const stats = {
};
class StatsBadge extends React.Component {
getBadgeType(stat, rate) {
static getBadgeType(stat, rate) {
const len = stat.badgeRanges.length;
for (let i = 0; i < len; i += 1) {
if (rate > stat.badgeRanges[i]) {
@@ -70,7 +70,7 @@ class StatsBadge extends React.Component {
return null;
}
const badgeType = this.getBadgeType(stat, rate);
const badgeType = StatsBadge.getBadgeType(stat, rate);
const badge = badges[badgeType] || null;
if (!badge) {
return null;