Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0aade0
commit 52cd1b8
Showing
6 changed files
with
54 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
|
||
// This is comment... | ||
class MyComponent extends React.Component { | ||
constructor() { | ||
super(); | ||
|
||
this.state = { | ||
title: 'World' | ||
}; | ||
} | ||
|
||
componentDidMount() { | ||
console.log('MyComponent is mounted!'); | ||
} | ||
|
||
clickHandler(title) { | ||
this.setState({ title }); | ||
} | ||
|
||
render() { | ||
const { title } = this.state; | ||
|
||
return ( | ||
<div> | ||
<h1>Hello, {title}!</h1> | ||
<button onClick={() => this.clickHandler('React')}> | ||
Change title | ||
</button> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default MyComponent; |