Advertisement
Guest User

Untitled

a guest
May 30th, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. var PersonView = React.createClass({
  2. getInitialState: function() {
  3. return { name: 'Erin', age: 32 };
  4. },
  5. componentDidMount: function() {
  6. setTimeout(function() {
  7. this.setState({ age: 33 });
  8. }.bind(this), 1000);
  9. },
  10. render: function() {
  11. return (
  12. <div>
  13. <h1>{this.state.name}</h1>
  14. <div>Age: {this.state.age}</div>
  15. </div>;
  16. );
  17. }
  18. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement