-
var
는function-scoped
이고,let
,const
는block-scoped
입니다. -
function-scoped
와block-scoped
가 무슨말이냐?
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
import React, { useState } from 'react'; | |
import './scss/App.scss' | |
function App() { | |
const [todoValue, setTodoValue] = useState(''); | |
const [todos, setTodo] = useState([]) | |
const handleChange = e => { | |
setTodoValue(e.target.value); | |
} |
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
var path = require('path'); | |
module.exports = { | |
entry: path.resolve(__dirname, 'src') + '/app/index.js', | |
output: { | |
path: path.resolve(__dirname, 'dist') + '/app', | |
filename: 'bundle.js', | |
publicPath: '/app/' | |
}, |
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
import React from 'react'; | |
import Video from './Video'; | |
class MyGenericApp extends React.Component { | |
render() { | |
return <div> | |
<Video src="my_video_url" poster="my_poster_url" /> | |
</div>; | |
} | |
} |