Fork me on github
1 2 3 4 5 ··· 19 下一页
摘要: https://github.com/zjy4fun/react-fc-order import React, { useEffect, useState } from 'react' import './App.css' function App() { const [count, setCoun 阅读全文
posted @ 2024-04-04 19:37 zjy4fun 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 把 dev 分支上多个提交记录合并成一个提交记录,这样你就可以在自己的分支上瞎几把高频率提交了🤣 git merge --squash dev git commit -m "合并 dev 分支上的多个提交记录" 阅读全文
posted @ 2023-12-29 22:02 zjy4fun 阅读(16) 评论(0) 推荐(0) 编辑
摘要: expo 官网 https://expo.dev/ https://github.com/expo/expo 用于简便移动端开发 快速创建项目 npx create-expo-app my-app . ├── App.js ├── app.json ├── assets ├── babel.conf 阅读全文
posted @ 2023-12-17 05:04 zjy4fun 阅读(46) 评论(0) 推荐(0) 编辑
摘要: UI Thread 负责用户界面的主要线程,用于处理用户界面的渲染、交互和更新。 如果在 UI 线程上执行耗时的操作,可能会导致界面卡顿,用户体验下降。 Main Thread 应用程序的主要执行线程,负责处理应用程序的主要逻辑、启动和管理应用。 在 React Native 中,UI 线程和主线程 阅读全文
posted @ 2023-12-17 04:57 zjy4fun 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 用于下拉刷新,example => https://github.com/zjy4fun/rn-FlatList-refreshControl import React, {useEffect, useState} from 'react'; import {FlatList, RefreshCon 阅读全文
posted @ 2023-12-17 04:46 zjy4fun 阅读(27) 评论(0) 推荐(0) 编辑
摘要: View 的布局发生改变的时候会触发 onLayout 函数,可以在布局发生变化的时候执行一些自定义操作,或者动态调整 UI 元素的样式和布局。 import React, { Component } from 'react'; import { View, Text } from 'react-n 阅读全文
posted @ 2023-12-17 04:15 zjy4fun 阅读(90) 评论(0) 推荐(0) 编辑
摘要: ## 使用原子化 CSS 工具包 比如把常见的 flex 布局封装成一个类名,这样就可以直接在 HTML 中使用了。 ```css .flexCenter { display: flex; flex-direction: row; justify-content: center; align-ite 阅读全文
posted @ 2023-11-07 00:19 zjy4fun 阅读(8) 评论(0) 推荐(0) 编辑
摘要: <html> <head> <title>flex 中设置高度的问题</title> </head> <body> <!-- 1. 容器设置为 flex,设置宽高会有什么影响,父容器和子容器默认宽高是多少 2. 如果容器宽高使用百分比表示,会有什么不同和影响? --> <div class="con 阅读全文
posted @ 2023-11-07 00:12 zjy4fun 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 设置宽高 w-number, h-number flex 实现水平垂直居中 flex设置容器为 flex 容器 flex-row / flex-col 设置主轴方向 justify-center 设置主轴方向居中,类似还有 justify-start, justify-end items-cente 阅读全文
posted @ 2023-11-01 22:09 zjy4fun 阅读(101) 评论(0) 推荐(0) 编辑
摘要: redux 是一个状态管理库,独立存在,可以借助 react-redux 库与 react 配合使用。 介绍几个概念: store 包含状态数据,所有组件可以访问并操作里面的状态数据 action 描述了发生了什么动作和事情,不包含状态本身 reducer 纯函数,接受当前状态和一个动作作为参数,并 阅读全文
posted @ 2023-10-29 01:03 zjy4fun 阅读(8) 评论(0) 推荐(0) 编辑
1 2 3 4 5 ··· 19 下一页