Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making sure withOffset works in tandem #267

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

timbrandin
Copy link

@timbrandin timbrandin commented May 7, 2020

When rendering an animated component that uses two withOffset values, they will affect each other and keep incrementing if we don't reset the state to undetermined, because in PanGestureHandler it does not reset by itself.

Edit: a better solution I came up with was to add onChange around the cond, so that it doesn't re-trigger due to another variable updating.

return (
  <Animated.View
    style={{
      width: sub(value2, value1),
    }}
  />
);

When rendering an animated component that uses two withOffset values, they will affect each other and keep incrementing if we don't reset the state to undetermined, because in PanGestureHandler it does not reset by itself.

```
return (
  <Animated.View
    style={{
      width: sub(value2, value1),
    }}
  />
);
```
@wcandillon
Copy link
Owner

Can you tell me more about this, I'm not sure I understand.

@timbrandin
Copy link
Author

Better I show instead!
image

Before:
withOffset_before

After:
withOffset_after

);
block([
onChange(state, [
cond(eq(state, State.END), [
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

value shouldn't be written here. Should it be a separate function?

@a-eid
Copy link

a-eid commented May 27, 2020

@timbrandin Hi, I am wondering this component open source ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants