본문 바로가기

개발(라이브러리,프레임워크)79

컴포넌트 class 컴포넌트 function 컴포넌트 //정의 1 function FunctionComponent(){ return hello; } // 사용 ReactDOM.render(, document.querySelector("#root")) //정의 2 const FunctionComponent = () => Hello; // 사용 2 ReactDOM.render(, document.querySelector("#root")) React.createElement로 컴포넌트 만들기 // React.createElement( // type, //태그 이름 문자열 | 리엑트 컴포넌트 | React.Fragment // [props], //리엑트 컴포넌트에 넣어주는 데이터 객체 // [...children] //.. 2021. 9. 24.
라이프사이클 Life Cycle props / state에서 re render 되지 않게 조절 할 수 있음 CompenetWillReceiveProps props를 새로 지정했을 때 바로 호출됨 state변경에는 반응x props값에따라 stat변경을 원하면 setState를 이용해 state를 변경한다. 다음이벤트로 가는것이 아니라 한번에 변경됨 shouldComponentUpdate props만 변경되어도 state만 변경되어도 props & state 둘다 변경되어도 newProps와 new State를 인자로 해서 호출 return type 이 boolean 임 ture 면 render false 면 render가 호출 x 디폴트는 true compoentWillUpdate 컴포넌트 재 랜더링 되기 직전에 불.. 2021. 9. 23.
props 와 state props 와 state props 컴포넌트 외부에서 컴포넌트에게 주는데이터 State 컴포넌트 내부에서 변경 할 수 있는 데이터 둘다 변경이 발생하면 랜더가 다시 일어날 수 있음 render 함수 props 와 state를 바탕으로 컴포넌트를 그린다. 그리고 props 와 state가 변경되면, 컴포넌트를 다시 그린다. 컴포넌트를 그리는 방법을 기술하는 함수가 랜더함수이다. props 예시 function //props >> {message: "하이하이"} 로 들어옴 function Component(props) { return ( {props.message} 함수로만든컴포넌트 ); } ReactDOM.render( , document.querySelector("#root")) class class C.. 2021. 9. 23.
jenkins 빌드 설정 세팅 jenkins 빌드 설정 세팅 1. credintial 을 ssh key로 등록한다. 2. gitlab의 ssh url 을 넣는다. 3. Execute shell에 build script 입력함 4. ssh publisher내용 입력 2021. 9. 21.
반응형