Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
1
var React = require('react'),
scripts = require('./js/jsonld/scripts');
//var Main = require('./main');
var Preloader = React.createClass({
//
propTypes: {
data: React.PropTypes.array.isRequired,
new: React.PropTypes.object.isRequired
},
componentWillMount(){
this.checkNew();
},
checkNew: function() {
if(this.props.new){
this.setState({
container : 'preloader-wrapper loading 1'
});
} else {
this.setState({
container: 'preloader-wrapper loaded switch 2 '
});
}
},
getInitialState: function() {
return {container : 'preloader-wrapper loaded switch 3'};
},
componentDidMount: function() {
var self = this;
window.addEventListener('load ', self.changClass(), false);
},
changClass: function() {
this.setState({
container : 'preloader-wrapper loaded switch 4'
});
},
render: function() {
return (
);
}
});
<Main data={this.props.data} />
module.exports = Preloader;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.