목록ReactJS (5)
Ajax(Asynchronous JavaScript and XML)비동기 데이터 교환 Fetch (React Native Doc) fetch( 'https://mywebsite.com/mydata.json' ); 임의의 URL에서 콘텐츠를 가져오려면 URL fetch에 전달 fetch('https://mywebsite.com/endpoint/', { method: 'POST', headers: { Accept: 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ firstParam: 'yourValue', secondParam: 'yourOtherValue', }),}); HTTP 요청을 사용자 정의 . 추가 ..
State : React 컴포넌트 내부 오브젝트중 하나 state 변경시 render 실행 state = { greeting: `hello`, movies : [ { title :"matrix", poster : "http://ticketimage.interpark.com/Movie/still_image/V16/V1601447p_s01.gif" }, { title : "Full Metal Jacket", poster : "https://www.imagetoday.co.kr/images/event/event_201810_pop.jpg" }, { title : "Old Boy", poster : "http://img2.sbs.co.kr/img/sbs_cms/PG/2015/09/04/PG39131527_w12..
Component Life Cycle ## Render componentWillMount(){ console.log("component will mount") //1 } render() { console.log("render") //2 } componentDidMount(){ console.log("component Did mount") //3 } ## Update componentWillReceiveProps(){ //new props } shouldComponentUpdate(){ //old props, new props 비교 } componentWillUpdate(){ // 비교 후 다르면 업데이트 진행 } render(){ // new props 그리고 } componentDidUpdate(){ ..
JSX 리액트 컴포넌트 생성 언어 컴포넌트는 render function 기본으로 가지고 있음 React : UI 라이브러리ReactD OM : React를 웹사이트로 출력(render) 모델 React웹사이트로 표현 > ReactDOM모바일로 표현 > ReactNative prop-types Install npm install --save prop-types npm install --save prop-types static propTypes= { title : PropTypes.string, poster : PropTypes.string } render(){ return( {this.props.title} ) } propTypes를 데이터 형 지정 poster : PropTypes.string.isRe..
reactJS 설치 : sudo npm install -g create-react-app // permission denied 발생시 sudo 추가 ReactJS Project 생성 : 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 this, yo..