Skip to content

Instantly share code, notes, and snippets.

View nayunhwan's full-sized avatar
👨‍🎨
Artistic Programmer

Yunhwan Logan Na nayunhwan

👨‍🎨
Artistic Programmer
View GitHub Profile
@nayunhwan
nayunhwan / FunctionalComponent.js
Last active December 27, 2016 16:59
Initializing Component with function
function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}
@nayunhwan
nayunhwan / TickingClock.js
Last active December 27, 2016 16:55
React Reference TickingClock Example
function tick() {
const element = (
<div>
<h1>Hello, world!</h1>
<h2>It is {new Date().toLocaleTimeString()}.</h2>
</div>
);
ReactDOM.render(
element,
document.getElementById('root')
@nayunhwan
nayunhwan / HelloWorld.js
Created December 27, 2016 16:57
Rendering "Hello, World!" in React
// This is index.js written by JSX
const element = <h1>Hello, world</h1>;
ReactDOM.render(
element,
document.getElementById('root')
);
class Welcome extends React.Component {
render() {
return <h1>Hello, {this.props.name}</h1>;
}
}
function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}
function App() {
return (
<div>
<Welcome name="Sara" />
<Welcome name="Cahal" />
<Welcome name="Edite" />
@nayunhwan
nayunhwan / ComposingComponent.js
Created December 28, 2016 07:04
React Composing Component Example
function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}
function App() {
return (
<div>
<Welcome name="Sara" />
<Welcome name="Cahal" />
<Welcome name="Edite" />
@nayunhwan
nayunhwan / ExtractingComponent.js
Created December 28, 2016 07:08
React Extracting Component Example
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}
@nayunhwan
nayunhwan / TickingClockWithComponent.js
Created December 28, 2016 07:44
React Example TickingClock with Comopnent
function Clock(props) {
return (
<div>
<h1>Hello, world!</h1>
<h2>It is {props.date.toLocaleTimeString()}.</h2>
</div>
);
}
function tick() {
@nayunhwan
nayunhwan / TickingClockWithComponent_index.js
Created December 29, 2016 07:07
React Ticking Clock with Component index.js
ReactDOM.render(
<Clock />,
document.getElementById('root')
);
@nayunhwan
nayunhwan / vscode.setting
Last active July 30, 2018 06:35
Visual Studio Setting
{
"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,