전체 글 9

리액트 네이티브 네비게이터 헤더 버튼 변수가 undefined 일 때

id 값을 useSelector로 잘 받아오고 있었는데 헤더 버튼을 클릭하자 id 값이 undefined가 찍혔다 어떻게 된 일 일까? const id = useSelector(state => state.auth.id) function submit(){ console.log(id) //undefined!! } useLayoutEffect(() => { navigation.setOptions({ headerRight: () => ( ) }) }, [navigation]) 헤더버튼은 랜더링 될 때 최초 한 번 찍히므로 예전 id의 값을 가지고 있는 듯 하다. 그러므로 배열에 navigation 말고 id를 넣어준다. const id = useSelector(state => state.auth.id) func..

src 2021.08.24

리액트 함수형 컴포넌트에서 상속해결

https://reactjs.org/docs/composition-vs-inheritance.html Composition vs Inheritance – React A JavaScript library for building user interfaces reactjs.org 컴포넌트 안에 컴포넌트를 넣음으로 해결한다. 컴포넌트 사이에 위치한 컴포넌트는 prop.children 으로 받아와서 부모 컴포넌트에 넘겨준다. const Parent = ({children}) => { // parent props & state // parent methods... return ( {children} ) } const Children = () => { return ( Hello React Native! ) } con..

src 2021.08.09

react native 원형 border radius 만들기

https://stackoverflow.com/questions/30404067/creating-css-circles-in-react-native Creating css circles in react-native I'm having some trouble creating css circles in react-native. The following works in iPhone 6 Plus but in all the other iPhones, they become diamonds. circle: { height: 30, width: 30, stackoverflow.com 리액트 네이티브에서는 borderRadius : '50%' // wrong (x) 테두리 속성에 문자열 %를 줄 수 없다. 그러므로 크기의..

style 2021.08.08

시작했습니다.

안녕하세요 리액트 네이티브 시작했습니다. 안드로이드 및 아이폰 앱 개발 경험은 없습니다. 노드 및 타입스크립트, JS 진영 개발 경력 없습니다. 맨땅에 헤딩입니다. 오로지 리액트 네이티브만 가지고 승부합시다. 제가 만든 앱을 주변사람들이 쓰는 모습을 보고 싶습니다. 불가능해 보이지만 될 때까지 계속 하겠습니다. 지켜봐주세요 감사합니다. 2021 08 08

goal 2021.08.08