ReactNative中封装一个组件
在ReactNative封装一个组件定义组件的Props1234567891011121314151617181920type ModalProps = Partial<React.ComponentProps<typeof Modal>>type dataItem = { icon: string, title: string, color: string, handle?: (params: any) => void}interface ModalComponentProps extends Omit<ModalProps, 'list' | 'ref' | 'title'> { title: string; list?: dataItem[]; /..
Read morereact自动化测试
安装yarn add @testing-library/react-hooks msw -D 使用在src下面新建一个文件夹__test__(双下划线) 传统的单元测试传统的单元测试通常来测一个方法或者函数:
Read more常用的style样式
记录一下做项目时经常用到的样式 background-color: rgb(244, 245, 247); 用于背景是纯白的灰色 box-shadow: rgba(0,0,0,0.1) 0 0 10px; 四周的阴影 12345678// 滚动条,只在当前组件滚动,其余地方不滚动const TaskContainer = styled.div` overflow: scroll; flex: 1; ::-webkit-scrollbar { display: none; }`;
Read more