diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-04-29 08:40:06 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-04-29 08:40:06 -0400 |
commit | 1f4974dc02c786b65c802d4497fd736cca79d01c (patch) | |
tree | 1007e452c4a9345dee8aff113f28f235432bf323 /webapp/components/more_channels.jsx | |
parent | 9961ccca7d39bdfabbafce423d3f7fe4b6ed2f29 (diff) | |
download | chat-1f4974dc02c786b65c802d4497fd736cca79d01c.tar.gz chat-1f4974dc02c786b65c802d4497fd736cca79d01c.tar.bz2 chat-1f4974dc02c786b65c802d4497fd736cca79d01c.zip |
General react performance improvements (#2796)
* General React performance improvements
* Cleaned up unused props/state in PermaLinkView and PostFocusView
Diffstat (limited to 'webapp/components/more_channels.jsx')
-rw-r--r-- | webapp/components/more_channels.jsx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/webapp/components/more_channels.jsx b/webapp/components/more_channels.jsx index 04c613ce5..087db68e6 100644 --- a/webapp/components/more_channels.jsx +++ b/webapp/components/more_channels.jsx @@ -2,17 +2,22 @@ // See License.txt for license information. import $ from 'jquery'; -import ReactDOM from 'react-dom'; +import LoadingScreen from './loading_screen.jsx'; +import NewChannelFlow from './new_channel_flow.jsx'; + +import ChannelStore from 'stores/channel_store.jsx'; + import * as Utils from 'utils/utils.jsx'; import * as AsyncClient from 'utils/async_client.jsx'; import * as GlobalActions from 'action_creators/global_actions.jsx'; -import ChannelStore from 'stores/channel_store.jsx'; -import LoadingScreen from './loading_screen.jsx'; -import NewChannelFlow from './new_channel_flow.jsx'; import {FormattedMessage} from 'react-intl'; import {browserHistory} from 'react-router'; +import React from 'react'; +import ReactDOM from 'react-dom'; +import PureRenderMixin from 'react-addons-pure-render-mixin'; + import loadingGif from 'images/load.gif'; function getStateFromStores() { @@ -22,8 +27,6 @@ function getStateFromStores() { }; } -import React from 'react'; - export default class MoreChannels extends React.Component { constructor(props) { super(props); @@ -33,6 +36,8 @@ export default class MoreChannels extends React.Component { this.handleNewChannel = this.handleNewChannel.bind(this); this.createChannelRow = this.createChannelRow.bind(this); + this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this); + var initState = getStateFromStores(); initState.channelType = ''; initState.joiningChannel = -1; |