Does the statics object work with ES6 classes in React?
class SomeComponent extends React.Component {
render() {
// ...
}
}
React.statics = {
someMethod: function() {
//...
}
};
Something like the above gives me undefined method someMethod
when I do SomeComponent.someMethod()
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…