사이트 : 노마드코더
강의 : ReactJS로 영화 웹 서비스 만들기
시각 : 2022.04.21
◆ 완료한 강의 :
React App을 설치하여 기본제공 파일들을 손쉽게 수정할 수 있다.
이전 강의처럼 한 파일에 일일이 함수 component를 만들 필요없이
각각의 component 파일을 만들어 관리할 수 있다.
import 명령을 통해 다른 파일을 불러올 수 있다.
ex:)import Button from "./Button";
import styles from "./App.module.css";
위의 구문에서 'Button'과 'styles'는 객체로 생성된다.
styles.~~~ 처럼 문장을 작성할 수 있게 된다.
App.js 파일 속 코드
import Button from "./Button";
import styles from "./App.module.css";
function App() {
return (
<div>
<h1 className={styles.title}>Welcome back!!!</h1>
<Button text={"Continue"} />
</div>
);
}
export default App;
App.module.css 파일 속 코드
.title {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
font-size: 18px;
}