status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.91k stars 987 forks source link

Dynamic updates inside the hole-view not working in Android #15577

Closed Parveshdhull closed 6 months ago

Parveshdhull commented 1 year ago

Problem

For creating mask effect/holes, we overlap components inside the hole-view.

This component should be static, if it is dynamic like getting an update with reanimated or some reagent atom then those updates don't work in Android.

Currently, we have a way around for cases with reagent updates. We can just pass a param key to the hole key and update that with the help of a reagent atom, which will force rerender hole-view and child components.

But this is not an optimal solution because rerendering degrades the performance and shouldn't be used for fast response time components like bottom tabs.

Although re-rendering with the help of key param works almost in all cases, for some reason it didn't update the view which was using fast-image instead of the react-native image component.

UPD: Fast-image itself usage reagent atom to dynamically update view when image is loaded, that's why it don't work inside hole-view. Because even if we rerender fast-image view, initial state is still loading and we update image after that

We should look into this library to figure out why behaviour is different in android and ios, and fix issue: https://github.com/status-im/status-mobile/pull/15561#issuecomment-1494063367 UPD: fixed create profile issue in https://github.com/status-im/status-mobile/pull/16001

Parveshdhull commented 6 months ago

Not a bug, just a technical limitation