Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var PersonView = React.createClass({
- getInitialState: function() {
- return { name: 'Erin', age: 32 };
- },
- componentDidMount: function() {
- setTimeout(function() {
- this.setState({ age: 33 });
- }.bind(this), 1000);
- },
- render: function() {
- return (
- <div>
- <h1>{this.state.name}</h1>
- <div>Age: {this.state.age}</div>
- </div>;
- );
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement