2

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?

0

1 Answer 1

3

Like this

var GridBox = React.createClass({
    a: 10,

    handlePaging: function(modifier) {
        console.log(this.a);
    }
});
Sign up to request clarification or add additional context in comments.

1 Comment

That was my initial thought too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.