DoubleBounce animation lag

未关闭
#30 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1-3 小时
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
javascript, react-native
领域
mobile-dev

调研方向

先阅读 src/DoubleBounce.js,并将其中的 componentDidMount 和 animate 方法与报告的补丁进行比较。完成的标准是 DoubleBounce 动画在没有报告的延迟的情况下开始,并按预期交替;issue 正文链接到了 pull request #29,因此请先检查这项工作再继续。

由索引模型根据 Issue 内容生成。

描述

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

I have problem with DoubleBounce animation. It starts after 1 second after render and its looks weird.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-loader/src/DoubleBounce.js b/node_modules/react-native-loader/src/DoubleBounce.js
index 5cf93c1..4c324c4 100644
--- a/node_modules/react-native-loader/src/DoubleBounce.js
+++ b/node_modules/react-native-loader/src/DoubleBounce.js
@@ -25,7 +25,7 @@ export default class Pulse extends Component {
 
   componentDidMount() {
     this.animate(0);
-    setTimeout(() => this.animate(1), 1000);
+    this.animate(1);
   }
 
   componentWillUnmount() {
@@ -36,12 +36,12 @@ export default class Pulse extends Component {
     Animated
       .sequence([
         Animated.timing(this.state.bounces[index], {
-          toValue: 1,
+          toValue: index,
           duration: 1000,
           useNativeDriver: false
         }),
         Animated.timing(this.state.bounces[index], {
-          toValue: 0,
+          toValue: !index,
           duration: 1000,
           useNativeDriver: false
         })

This issue body was partially generated by patch-package.

Pull request for this issue: https://github.com/mohebifar/react-native-loader/pull/29

主要语言
JavaScript
星标
390
派生
63
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

mohebifar/react-native-loader 的其他 Issue

查看 mohebifar/react-native-loader 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。