Page MenuHomePhabricator

[native] Convert ChatThreadListSearch to Reanimated 2 syntax
ClosedPublic

Authored by ashoat on Tue, May 21, 2:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 15, 3:23 PM
Unknown Object (File)
Fri, Jun 14, 4:59 AM
Unknown Object (File)
Sat, Jun 8, 11:53 AM
Unknown Object (File)
Thu, Jun 6, 5:42 PM
Unknown Object (File)
Thu, Jun 6, 2:05 PM
Unknown Object (File)
Thu, Jun 6, 1:18 PM
Unknown Object (File)
Thu, Jun 6, 1:33 AM
Unknown Object (File)
Tue, Jun 4, 7:51 PM
Subscribers

Details

Summary

Addresses ENG-8148.

Note that I replaced animateTowards with something more simple. The difference is the animation is reversed while partway through, it will still take the same length as if it was started from an end state.

Test Plan

On both iOS and Android physical devices, tested ChatThreadListSearch to confirm no functionality regressed.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/chat/chat-thread-list-search.react.js
48 ↗(On Diff #40517)

How come we don't specify the duration? It used to be 100, and the default for withTiming is 300. Do we want it to take longer now?

native/chat/chat-thread-list-search.react.js
48 ↗(On Diff #40517)

Good call – I'll fix this

Actually, I experimented with this and found 100ms to be too short. I'd like to change it to 300ms.

Meanwhile, I decided that we had too many animated variables here... we don't need to have a boolean that triggers animation, we can just trigger animation directly.

Finally: I noticed some unrelated issues with this component. Will address them in a later diff.

native/chat/chat-thread-list-search.react.js
46 ↗(On Diff #40630)

Shouldn't this also be withTiming(0)?

native/chat/chat-thread-list-search.react.js
46 ↗(On Diff #40630)

No, I think we shouldn't be calling withTiming from a render function. It should be called from a callback, an effect, or within a worklet.

If you want an animation to start when a component is rendered, I think the best way to do that is by triggering it from an effect.

This revision is now accepted and ready to land.Fri, May 24, 7:45 AM