리액트 네이티브에서 style 을 조건에 따라 적용하는 법 (How to apply style with conditional in React Native)
## 리액트 네이티브에서 style 을 조건에 따라 적용하는 법 (How to apply style with conditional in React Native) 최근 리액트 네이티브 프로젝트에 참가하게 됐다. JavaScript 를 자주 쓰진 않아 상당히 어색하지만, 빠르게 적응하려고 노력 중이다. 작업 중 React Native에서 Style을 조건에 따라서 적용해야 하는 상황이 있었는데 다음과 같이 처리할 수 있다. ``` return ( ) const styles = StyleSheet.create({ yellowContainer: { backgroundColor: '#fff000' }, greenContainer: { backgroundColor: '#08d13b' }, }) ``` Great!
댓글
댓글 쓰기