-
Notifications
You must be signed in to change notification settings - Fork 384
Include pure-render-decorator #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include pure-render-decorator #174
Conversation
@@ -73,7 +76,7 @@ class CommentForm extends React.Component { | |||
if (this.state.formMode < 2) { | |||
ref = this.refs.text.getInputDOMNode(); | |||
} else { | |||
ref = React.findDOMNode(this.refs.inlineText); | |||
ref = ReactDOM.findDOMNode(this.refs.inlineText); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a warning from React 0.14
Yesterday we discussed it and decided to stick with this solution for now, until decorators spec will be on stage 0 at least. @MaMute will update this PR. |
e7da899
to
21d088f
Compare
@justin808 @alexfedoseev this is ready |
@MaMute The idea is to create a parent /* Component.jsx */
class Component extends React.Component {
shouldComponentUpdate() {
return React.addons.PureRenderMixin.shouldComponentUpdate.apply(this, arguments);
}
} And then: import Component from './Component';
export default class EachComponentInApp extends Component {
// using `shouldComponentUpdate` from Component here...
} |
21d088f
to
4d95cf4
Compare
@alexfedoseev Done 👍 |
@MaMute Looks good 👍 One thing: let's place it in |
@alexfedoseev done 👍 |
@MaMute This is awesome. One last question. Is there any way we can have a test or something that confirms we're getting some benefit from this change? |
Include pure-render-decorator
Including pure render decorator as proposed in #141 and organizing imports.