본문 바로가기

redux4

[Reactive Native] 주문 하기 만들기 React Native 104 - 주문하기 장바구니에 담은 목록을 주문화면으로 가져와 본다. models/orders.js class Order { constructor(id, items, totalAmount, date) { this.id = id; this.items = items; this.totalAmount = totalAmount; this.date = date; } get readableDate() { return this.date.toLocaleDateString('ko-KR', { year: 'numeric', month: 'long', day: 'numeric', hour: '2-digit', minute: '.. 2020. 12. 8.
[React Native] Redux(Reducer, Actions) Shop App - 003 상품들을 장바구니에 추가하기 새로운 리듀서와, 액션함수를 생성합니다. 먼저 액션을 만들어봅시다. store/actions/cart.js export const ADD_TO_CART = 'ADD_TO_CART'; export const addToCart = (product) => { return { type: ADD_TO_CART, product: product }; }; 나중에 dispatch 함수에서 액션을 호출할 때 사용하게 될 ADD_TO_CART 변수를 정의하고, 이를 addToCart라는 액션함수에 type으로 넣어줍니다. 이 액션함수의 인풋은 상품인 product입니다. store/reducer/cart.js import { ADD_TO_CART } f.. 2020. 7. 5.
[React Native] redux, navigation 세팅 Shop App 001 쇼핑몰 앱을 만들어봅니다. 1 계획 1) product overview screen : image, title, cart, detail button 2) cart detail screen 3) product detail screen 4) Navigation : shop, orders, manage products orders mange products : plus button → edit product screen 2 생성, Setup Create $ expo init wordmall Setup $ npm install --save react-native react-native-screens $ npm install --save redux react-redux react-navig.. 2020. 7. 5.
[React Native] Setup, Redux, Navigation 세팅 Shop App 001 1 계획 1) product overview screen : image, title, cart, detail button 2) cart detail screen 3) product detail screen 4) Navigation : shop, orders, manage products orders mange products : plus button → edit product screen 2 생성, Setup Create $ expo init wordmall Setup $ npm install --save react-native react-native-screens $ npm install --save redux react-redux react-navigation react-nav.. 2020. 6. 19.
728x90