class ExampleComponent extends React.Component {
state = {
isReady: false,
};
hanldeOnLoad = () => {
this.setState({ isReady: true });
};
render() {
const { src } = this.props;
const { isReady } = this.state;
const className = isReady ? '' : 'some-class';
return (
<div className={className}>
<img onLoad={this.hanldeOnLoad} src={src} />
</div>
);
}
}
var BXForm = Object.create(Object);
BXForm.prototype.btnClick = function() {
console.log('btnClick called');
}
BXForm.prototype.init = function() {
this.btnClick();
console.log(this, 'init called');
}
BXForm.init();