Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>React Native & Redux Toolkit Exam SnippetsNew to Visual Studio Code? Get it now.
React Native & Redux Toolkit Exam Snippets

React Native & Redux Toolkit Exam Snippets

NoName

|
9 installs
| (0) | Free
Bộ khung gợi ý (cheat-sheet) tái sử dụng cho mọi đề thi React Native, Redux Toolkit, AsyncStorage, Navigation và Axios.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

React Native & Redux Toolkit Exam Snippets (Cheat-Sheet)

Bộ khung gợi ý (Cheat-Sheet Snippets) tái sử dụng cho mọi đề thi và dự án: React Native • Redux Toolkit • AsyncStorage • React Navigation • Axios

Bao gồm 2 bảng phím tắt tích hợp:

  1. Khung mẫu tổng quát (rx-*, rn-*): Khung sườn đa năng với tab-stops tự đổi tên biến cho mọi đề thi.
  2. Mẫu thực chiến từng file (yn-<tên file>): Sinh nguyên vẹn toàn bộ mã nguồn sạch của từng file từ dự án TK1 (App.tsx và toàn bộ thư mục src).

⚡ BẢNG 1: KHUNG MẪU TỔNG QUÁT (GENERIC TEMPLATES)

STT Phím tắt (Prefix) Tên chức năng Mô tả tóm tắt
1 rn-install Expo Core Install Lệnh npx/npm cài 1 lần đủ bộ thư viện nền tảng Expo, Redux, Navigation, Axios, json-server
2 rx-slice Generic Redux Slice Khung Slice đa năng: addItem, updateQuantity, removeItem, toggleItem, hydrate, hàm clamp
3 rx-store Redux Store Setup Cấu hình Store tối giản gom các Slice Reducer, không lo lỗi type TypeScript
4 rx-root Root App & Provider Khung file App.tsx bọc SafeAreaProvider, Provider, Root kiểm tra nạp cartOK & favoOk
5 rx-select Redux Selector Đọc dữ liệu từ state Redux nhanh 1 dòng với useSelector
6 rx-persist AsyncStorage Hook Hook usePersistSlice tự động lưu & nạp dữ liệu từ AsyncStorage
7 rx-debounce Debounce Action Hook Hook useDebouncedAction bấm tăng/giảm nhảy số UI tức thì qua drafts
8 rx-coupon Coupon Logic Logic kiểm tra mã qua API getAll, tính giảm giá percent/fixed, minOrder và tổng cộng
9 rx-labelcoupon Coupon UI Section Giao diện ô nhập mã, nút áp dụng, cảnh báo thiếu tiền và bảng tổng tiền (CSS inline)
10 rx-api Axios Platform Client Khung API tự nhận diện Android (10.0.2.2) và iOS/Web (localhost)
11 rx-confirm Multi-Platform Confirm Xác nhận đa nền tảng (window.confirm trên Web, Alert.alert trên Mobile)
12 rn-flatlist FlatList Grid/List Khung FlatList dạng lưới (2 cột / 1 cột), tự căn giữa khi mảng rỗng
13 rn-item Item Component Card Component thẻ sản phẩm đa năng (ảnh, tên, giá, nút bấm) bằng CSS inline
14 rn-empty Empty State Screen Giao diện màn hình rỗng có biểu tượng, thông báo và nút điều hướng
15 rn-nav Nested Navigation Điều hướng Bottom Tabs lồng trong Stack Navigator kèm Redux badge đếm số lượng
16 rn-style Utility Stylesheet Bảng StyleSheet tiện ích tái sử dụng (s.center, s.row, s.between, s.card,...)

🔥 BẢNG 2: MẪU THỰC CHIẾN TỪNG FILE TK1 (PREFIX yn-<tên file>)

Gõ tiền tố theo tên file cần tạo trong dự án (hỗ trợ cả gõ có đuôi hoặc không đuôi .tsx/.ts):

STT Phím tắt (Prefix) File nguồn tương ứng Mô tả chức năng
1 yn-App App.tsx Root App bọc Provider, NavigationContainer, ActivityIndicator nạp cart & wishlist
2 yn-type src/type.ts Định nghĩa toàn bộ kiểu dữ liệu TypeScript: Book, CartItem
3 yn-books src/api/books.ts Axios Client gọi API fetchBooks và fetchBookById
4 yn-store src/store/index.ts Cấu hình Redux Store kết hợp cartSlice và wishlistSlice
5 yn-cartSlice src/store/cartSlice.ts Slice giỏ hàng: addToCart, setQuantity, remove, hydrateCart
6 yn-wishlistSlice src/store/wishlistSlice.ts Slice yêu thích: toggleWishlist, hydrateWishlist
7 yn-usePersisSlice src/hooks/usePersisSlice.ts Hook đồng bộ AsyncStorage tự động cho Redux Slice
8 yn-AppNavigator src/navigation/AppNavigator.tsx Điều hướng Bottom Tabs lồng Stack Navigator kèm Cart Badge
9 yn-FavoriteButton src/components/FavoriteButton.tsx Component nút tim toggle yêu thích (♥ / ♡) kết nối Redux Store
10 yn-ProductItem src/components/ProductItem.tsx Thẻ sản phẩm hiển thị ảnh, nút tim và nút thêm vào giỏ hàng
11 yn-CartItem src/components/CartItem.tsx Item giỏ hàng có cụm nút tăng/giảm (+/-) số lượng và nút xoá (✕)
12 yn-HomeScreen src/screens/HomeScreen.tsx Màn hình trang chủ FlatList lưới 2 cột nạp sách từ API
13 yn-BookDetailScreen src/screens/BookDetailScreen.tsx Màn hình chi tiết sách lấy bookId từ route.params
14 yn-CartScreen src/screens/CartScreen.tsx Màn hình giỏ hàng tính tổng tiền subtotal và xác nhận xoá
15 yn-debounce src/screens/CartScreen.tsx Màn hình giỏ hàng kỹ thuật Debounce nhảy số tức thì qua drafts
16 yn-WishlistScreen src/screens/WishlistScreen.tsx Màn hình danh sách yêu thích có Empty State khi mảng rỗng
17 yn-AccountScreen src/screens/AccountScreen.tsx Màn hình tài khoản hiển thị số lượng sách yêu thích

📄 License

MIT License

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft