javascript - react-native-animated 中的 useTheme 和 useDerived 钩子
问题描述
我正在研究 react-native 但我不理解这些代码块。[ Source code link
][1] 在那个文件中,我没看懂这段代码
1)const { margin, normalize } = useTheme();
const BOOKW = normalize(130, 160);
为什么 BOOKW 长度受规范化限制?
2) const position = useDerivedValue(() => (index + 0.00001) * (BOOKW + margin) - scrollX.value);
这个职位到底是如何运作的,我不明白吗?
PS我阅读了文档,但我有点不懂:( [1]:https ://github.com/himanchau/react-native-book-app/blob/main/src/components/Book.jsx
解决方案
推荐阅读
- spring - Spring Boot 2 中针对 Actuator 和自定义 API 端点的单独身份验证提供程序
- unicode - 有没有办法绕过pdfmake上的这个错误?“类型错误:无法读取 null 的属性‘音节’”
- sdl-2 - 使用硬件加速渲染器时,SDL2 渲染复制不再起作用
- mongodb - pymongo 查询错误中的 upsert 和 arrayfilters - TypeError: upsert must be True or False
- python-3.x - 如何停止 Chatterbot 培训文件每次下载和显示日志?
- java - 为什么 Room 在迁移后删除我的数据库
- java - 派生查询的 Spring jpa 拦截器
- postgresql - 根据某些键将 csv 文件导入 postgres 表
- amazon-web-services - 允许 EC2 实例使用 CA 证书通过 SSL 连接到 RDS MySQL 实例
- sql - 此代码不会将数据插入数据库并且没有错误或异常?