{"action":"closed","issue":{"url":"https://api.github.com/repos/davidchang/ngReact/issues/102","labels_url":"https://api.github.com/repos/davidchang/ngReact/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/davidchang/ngReact/issues/102/comments","events_url":"https://api.github.com/repos/davidchang/ngReact/issues/102/events","html_url":"https://github.com/davidchang/ngReact/issues/102","id":106281253,"number":102,"title":"How to maintain react state instead of props in react?","user":{"login":"cloudybrain","id":3813895,"avatar_url":"https://avatars.githubusercontent.com/u/3813895?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudybrain","html_url":"https://github.com/cloudybrain","followers_url":"https://api.github.com/users/cloudybrain/followers","following_url":"https://api.github.com/users/cloudybrain/following{/other_user}","gists_url":"https://api.github.com/users/cloudybrain/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudybrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudybrain/subscriptions","organizations_url":"https://api.github.com/users/cloudybrain/orgs","repos_url":"https://api.github.com/users/cloudybrain/repos","events_url":"https://api.github.com/users/cloudybrain/events{/privacy}","received_events_url":"https://api.github.com/users/cloudybrain/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/davidchang/ngReact/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-14T06:44:22Z","updated_at":"2015-09-16T06:40:44Z","closed_at":"2015-09-16T06:40:44Z","body":"I have something that looks like this:\r\n\r\n    <react-component name=\"example\" framesize=\"FrameSizeData\" />\r\n\r\nHowever I'd like to configure changes, so that when new data is changed, the component would be re-rendered to reflect the changes\r\n\r\n    var example = React.createClass({\r\n        getInitialState:  function () {\r\n            return {\r\n                test = \"\"\r\n            }\r\n        },\r\n    },\r\n    handleClick: function () {\r\n        this.setState({\r\n            test : \"test1\"\r\n        });\r\n    },\r\n    render: function() {\r\n        return (\r\n            <div>\r\n                <input type=\"text\" ref=\"myTextInput\" value=\"this.state.test\" />\r\n                <input\r\n                    type=\"button\"\r\n                    value=\"Focus the text input\"\r\n                    onClick={this.handleClick}\r\n             />\r\n          </div>\r\n        );\r\n    }});\r\n\r\nThe only way I was able to do this was create my own global variables, and pass in data from the controller, and when it builds the react component, it will take that global variable. But I'd rather have a way to pass in $scope instead."}}