Files
expo-popcore-app/CLAUDE.md
imeepos 1f9b6e22d6 feat: 添加测试框架和优化项目结构
- 添加 Jest 配置和测试设置
- 添加 use-categories hook 的单元测试
- 更新 CLAUDE.md 添加包管理工具说明
- 优化首页、视频页和频道页的组件结构
- 添加 .claude 命令配置文件
- 移除 bun.lock 和 package-lock.json,统一使用 bun
- 更新 package.json 依赖

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-19 10:53:54 +08:00

102 lines
2.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
包管理工具bun
这是一个expo项目技术栈 tailwindcss + react native + zustand 状态管理
设计稿宽度是375px如果用户发送了样式代码需要将它转换成tailwindcss
常用库:
```tsx
import { mediaDevices, RTCView } from "react-native-webrtc";
import { Canvas, type CanvasRef } from "react-native-wgpu";
import { Animated, StyleSheet, Text, View, PixelRatio } from "react-native";
export { ErrorBoundary, Stack } from "expo-router";
import { NativeStackNavigationOptions } from "@react-navigation/native-stack";
import * as Linking from 'expo-linking';
import * as WebBrowser from 'expo-web-browser';
import Constants from 'expo-constants';
import { Video } from "expo-av";
import { useFonts } from "expo-font";
import { VictoryBar, VictoryChart } from "victory-native";
import "@expo/metro-runtime";
import * as SQLite from "expo-sqlite";
import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context";
import { createStore } from "tinybase";
import { createLocalPersister } from "tinybase/persisters/persister-browser";
import { createExpoSqlitePersister } from "tinybase/persisters/persister-expo-sqlite";
import {
Provider,
useAddRowCallback,
useCreatePersister,
useCreateStore,
useDelTableCallback,
useHasTable,
useRow,
useSetCellCallback,
useSortedRowIds,
} from "tinybase/ui-react";
import { GLView } from "expo-gl";
import { Renderer, TextureLoader } from "expo-three";
import { Camera } from "expo-camera";
import { cameraWithTensors } from '@tensorflow/tfjs-react-native';
import * as tf from "@tensorflow/tfjs";
import {
useCssElement,
useNativeVariable as useFunctionalVariable,
} from "react-native-css";
import Animated from "react-native-reanimated";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import styled from "styled-components/native";
import { handleURLCallback, StripeProvider } from "@stripe/stripe-react-native";
import type { Stripe } from "stripe";
import {
SQLiteProvider,
useSQLiteContext,
type SQLiteDatabase,
} from 'expo-sqlite';
import * as SplashScreen from "expo-splash-screen";
import { Asset } from "expo-asset";
import * as Updates from "expo-updates";
import io from "socket.io-client";
```
- 状态管理
```tsx
import create from "zustand";
const initialState = {
items: [],
};
export const useStore = create((set, get) => {
return Object.assign(initialState, {
items: [],
addItem(text) {
const items = get().items;
set({ items: [...items, { text, id: Math.random() }] });
},
});
});
export function useReset() {
useStore.setState(initialState);
}
```
```tsx
import shallow from "zustand/shallow";
import { useReset, useStore } from "./store";
const { items, addItem } = useStore(
({ addItem, items }) => ({
items,
addItem,
}),
shallow
);
<Button onPress={() => useReset()} title="reset" />
```