- component 만들기
- Subject, TOC, Contents 라는 컴포넌트를 만들어 사용함
import { className } from 'postcss-selector-parser';
import React, {Component} from 'react';
import './App.css';
class Subject extends Component {
render(){
return (
<header>
<h1> web</h1>
world wide web
</header>
)
}
}
class TOC extends Component {
render(){
return (
<nav>
<li><a href="1.html"> html</a></li>
<li><a href="2.html">css</a></li>
<li><a href="3.html">javascript</a></li>
</nav>
)
}
}
class Contents extends Component {
render(){
return (
<article>
<h2> html</h2>
html is hypertext ...
</article>
)
}
}
class App extends Component {
render(){
return(
<div className="App">
<Subject></Subject>
<TOC></TOC>
<Contents></Contents>
</div>
)
}
}
export default App;
'React' 카테고리의 다른 글
React - ESLint , Prettier, husky, lint-staged (0) | 2021.09.12 |
---|---|
React - props & state & event handling (0) | 2021.09.08 |
React library & JSX (0) | 2021.09.05 |
React 다른 새 프로젝트 생성 (1) | 2021.08.24 |
React ch.1 (0) | 2021.08.21 |