KIC/React 10

[React] 배열출력,전화번호부 미니프로젝트-데이터추가

create-react-app my-telephone src | component - App.js 이동 부트스트랩 설치 yarn add bootstrap@3.4.1 src/index.js(상위컴포넌트에 부트스트랩라이브러리 등록) Contact.js import React, { Component } from 'react'; import ContactDetails from './ContactDetails'; //추가 import ContactInfo from './ContactInfo'; //추가(배열의 추가,삭제,수정)->update import update from 'react-addons-update'; import ContactCreate from './ContactCreate'; class Cont..

KIC/React 2020.11.10

[React] Props, State

Props - 컴포넌트에서 사용 할 데이터 중 변동되지 않는 데이터를 다룰 때 사용 - parent 컴포넌트에서 child 컴포넌트로 데이터를 전할 때, props 가 사용 - 컴포넌트에서 immutable (변하지 않는) 데이터가 필요 할 땐, render() 메소드의 내부에 안에 { this.props.propsName } 형식으로 넣는다. - 컴포넌트를 사용 할 때, 괄호 안에 propsName="value" 를 넣어 값을 설정 index.html //추가 index.js import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; //App부모 컴포넌트만 새로 불러올 경로를 지정 import App fr..

KIC/React 2020.11.04

[React] JSX(JavaScript Expression)문법/ 예제(기본설정,백업,복사)

create-react-app myapp2 로 새로운 프로젝트 생성 cd myapp2 yarn start 로 엔진구동 확인 불필요한 파일 제거작업 1. public 폴더에 index.html만 남기고 삭제 2. src 폴더에 components 폴더 생성, App.js를 components폴더로 이동 3. index.js 경로 수정 import App from './components/App'; 4. App.js 함수 삭제하고 클래스로 작성하기위해 설정 rcc tab or enter yart start 서버구동 확인 서버구동 종료하고 myback 폴더 생성하고 myapp2폴더안의 내용전부를 복사 creat-app을 하지 않고 복사해서 사용하는 방법을 사용하기 위해서 이러한 작업을 했다. JSX 문법 1...

KIC/React 2020.11.03

[React] 설치 및 환경설정

vscode 터미널에서 1. npm install -g yarn로 yarn 프로그램 설치 2. npm install -g create-react-app => 자동으로 구조형성 3. create-react-app 프로젝트명 설치 완료화면 yarn start Starts the development server. yarn build Bundles the app into static files for production. yarn test Starts the test runner. yarn eject Removes this tool and copies build dependencies, configuration files and scripts into the app directory. If you do thi..

KIC/React 2020.11.02