Reputation: 15807
I have a class that looks like this :
var GridBox = React.createClass({
loadLoadDataFromServer: function(modifier) {
},
handlePaging: function(modifier) {
},
getInitialState: function() {
},
render: function(){
return (
);
}
});
How do I add a variable within this class that all of the functions can use?
Upvotes: 2
Views: 72
Reputation: 77482
Like this
var GridBox = React.createClass({
a: 10,
handlePaging: function(modifier) {
console.log(this.a);
}
});
Upvotes: 3