FE/React & RN36 [React] arrow function @이유 > setInteval 공부를 하면서 useEffect안에서 setState 를 사용하면서 발생하는 문제점 때문에 Arrow function > * arrow function은 자신을 포함하는 외부 scope에서 this를 계승받는다. useEffect(()=>{ //(1) const interval = setInterval(()=>{ let next = (index + 1) % loadingImages.length setIndex( next ) },200) //(2) const interval = setInterval(()=>{ setIndex( index => (index + 1) % loadingImages.length ) },200) return () => clearInterval(inte.. 2020. 2. 11. [ React ] Class Component @ https://jistol.github.io/frontend/2018/12/03/react-proptypes/ React Component의 prop값을 검증하기 위해 PropTypes를 이용하여 값을 지정할 수 있습니다. React v15.5부터 다른 패키지로 변경되었는데 ‘prop-types’라이브러리를 사용하라고 권고하고 있습니다. import React, { Component } from 'react'; import PropTypes from 'prop-types'; class Foo extends Component { ... static propTypes = { strArg : PropTypes.string, numArg : PropTypes.number.isRequired } } PropT.. 2019. 11. 13. [ React ] 생명주기 @ 궁금 > 영어를 잘봐라 @ 공부 https://velog.io/@kyusung/%EB%A6%AC%EC%95%A1%ED%8A%B8-%EA%B5%90%EA%B3%BC%EC%84%9C-%EC%BB%B4%ED%8F%AC%EB%84%8C%ED%8A%B8%EC%99%80-%EB%9D%BC%EC%9D%B4%ED%94%84%EC%82%AC%EC%9D%B4%ED%81%B4-%EC%9D%B4%EB%B2%A4%ED%8A%B8 import React from "react"; class Content extends React.Component { constructor(props) { super(props); } componentWillMount() { console.log("Component WILL MOUNT!"); } .. 2019. 11. 13. [ React-Native ] Style @ 이유? html 하고 다른 부분도 있고 html 에서 안다고 해도 잘 모르고 있던 부분이 많아서 정리 1. alignContent 2. alignItems 3. textAlign > react-native 에서 text를 중앙에 두기 위한 방법 4. ...StyleSheet.absoluteFillObject, > position: 'absolute', left: 0, right: 0, top: 0, bottom: 0 을 반복적으로 쓰기 싫을때 대신 커스텀으로 만들수도 있다. 5. Align Items Align Items는 배치방향(Flex Direction)으로부터 수직한 정렬을 뜻합니다. column(세로 배치)라면 가로 정렬을 뜻하고, row(가로 배치)라면 세로 정렬을 뜻합니다 Justify .. 2019. 11. 11. 이전 1 2 3 4 5 6 7 8 9 다음