View TickingClock.js
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
function tick() { | |
const element = ( | |
<div> | |
<h1>Hello, world!</h1> | |
<h2>It is {new Date().toLocaleTimeString()}.</h2> | |
</div> | |
); | |
ReactDOM.render( | |
element, | |
document.getElementById('root') |
View HelloWorld.js
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 is index.js written by JSX | |
const element = <h1>Hello, world</h1>; | |
ReactDOM.render( | |
element, | |
document.getElementById('root') | |
); |
View FunctionalComponent.js
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
function Welcome(props) { | |
return <h1>Hello, {props.name}</h1>; | |
} |
View ClassComponent.js
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
class Welcome extends React.Component { | |
render() { | |
return <h1>Hello, {this.props.name}</h1>; | |
} | |
} |
View ComposingComponent.js
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
function Welcome(props) { | |
return <h1>Hello, {props.name}</h1>; | |
} | |
function App() { | |
return ( | |
<div> | |
<Welcome name="Sara" /> | |
<Welcome name="Cahal" /> | |
<Welcome name="Edite" /> |
View ComposingComponent.js
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
function Welcome(props) { | |
return <h1>Hello, {props.name}</h1>; | |
} | |
function App() { | |
return ( | |
<div> | |
<Welcome name="Sara" /> | |
<Welcome name="Cahal" /> | |
<Welcome name="Edite" /> |
View ExtractingComponent.js
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
function Comment(props) { | |
return ( | |
<div className="Comment"> | |
<div className="UserInfo"> | |
<img className="Avatar" | |
src={props.author.avatarUrl} | |
alt={props.author.name} | |
/> | |
<div className="UserInfo-name"> | |
{props.author.name} |
View TickingClockWithComponent.js
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
function Clock(props) { | |
return ( | |
<div> | |
<h1>Hello, world!</h1> | |
<h2>It is {props.date.toLocaleTimeString()}.</h2> | |
</div> | |
); | |
} | |
function tick() { |
View TickingClockWithComponent_index.js
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
ReactDOM.render( | |
<Clock />, | |
document.getElementById('root') | |
); |
View vscode.setting
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
{ | |
"workbench.colorTheme": "Atom One Dark", | |
"atomKeymap.promptV3Features": true, | |
"editor.multiCursorModifier": "ctrlCmd", | |
"editor.tabSize": 2, | |
"editor.formatOnSave": true, | |
"editor.formatOnPaste": true, | |
"prettier.eslintIntegration": true, | |
"eslint.autoFixOnSave": true, | |
"tslint.autoFixOnSave": true, |
OlderNewer