Skip to content

Commit

Permalink
Update to React 15.6
Browse files Browse the repository at this point in the history
Once we're upgraded to React 15.x and have no deprecation warnings,
upgrading to React 16 should be painless.

PureRenderMixin has been superceded by PureComponent. According to the
docs PureComponent should only be used if all of it's children are also
"pure".

https://facebook.github.io/react/docs/react-api.html#react.purecomponent
  • Loading branch information
Graham42 committed Oct 7, 2017
1 parent 5de3656 commit c91c0da
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
6 changes: 2 additions & 4 deletions app/scripts/views/pie_chart.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import Chartist from "Chartist";
import React, { Component } from "react";
import PureRenderMixin from "react-addons-pure-render-mixin";
import React, { PureComponent } from "react";

export default class LevelView extends Component {
export default class LevelView extends PureComponent {
static propTypes = {
pieParts: React.PropTypes.array.isRequired
};

constructor(props, context) {
super(props, context);
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
}

render() {
Expand Down
2 changes: 0 additions & 2 deletions app/scripts/views/rhythm_settings_view.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component } from "react";
import PureRenderMixin from "react-addons-pure-render-mixin";
import RangeSettingComponent from "./range_setting_component";
import SettingLine from "./setting_line";
import AnalyticsService from "../services/analytics_service.js";
Expand All @@ -12,7 +11,6 @@ export default class PitchSettingsView extends Component {

constructor(props, context) {
super(props, context);
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
}

buildStateChanger(stateKey) {
Expand Down
2 changes: 0 additions & 2 deletions app/scripts/views/rhythm_statistic_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import _ from "lodash";

import AnimatedNumber from "./animated_number.js";
import StarAnimation from "./star_animation.js";
import PureRenderMixin from "react-addons-pure-render-mixin";

export default class RhythmStatisticView extends Component {
static propTypes = {
Expand All @@ -14,7 +13,6 @@ export default class RhythmStatisticView extends Component {

constructor(props) {
super(props);
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
}

getHumanReadableTime(milliseconds) {
Expand Down
8 changes: 3 additions & 5 deletions app/scripts/views/stave_renderer.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import Vex from "vexflow";
import React, { Component } from "react";
import React, { PureComponent } from "react";
import _ from "lodash";
import PureRenderMixin from "react-addons-pure-render-mixin";

class StaveRenderer extends Component {
class StaveRenderer extends PureComponent {
static defaultProps = {
staveCount: 2
};

static propTypes = {
keys: React.PropTypes.array,
keys: React.PropTypes.objectOf(React.PropTypes.array),
chordIndex: React.PropTypes.number,
keySignature: React.PropTypes.string,
staveCount: React.PropTypes.number
};

constructor(props) {
super(props);
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
}

render() {
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
"freezer-js": "git+https://github.com/philippotto/freezer.git#native-object-handling-build",
"html-loader": "^0.4.3",
"lodash": "^4.5.1",
"react": "^0.14.5",
"react-addons-pure-render-mixin": "^0.14.8",
"react": "^15.6.1",
"react-bootstrap": "^0.28.3",
"react-dom": "^0.14.5",
"react-dom": "^15.6.1",
"react-motion": "^0.4.2",
"react-range-slider-bem": "^0.2.11",
"vexflow": "^1.2.41"
Expand Down

0 comments on commit c91c0da

Please sign in to comment.