-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix(android): Unable to update properties for view tag #5216
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||||||||||
| package com.swmansion.reanimated; | ||||||||||||||
|
|
||||||||||||||
| import static java.lang.Float.NaN; | ||||||||||||||
|
|
||||||||||||||
| import android.util.Log; | ||||||||||||||
| import android.view.View; | ||||||||||||||
| import com.facebook.react.bridge.Arguments; | ||||||||||||||
| import com.facebook.react.bridge.GuardedRunnable; | ||||||||||||||
|
|
@@ -345,6 +345,19 @@ public void sendEvent(String name, WritableMap body) { | |||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| public void updateProps(int viewTag, Map<String, Object> props) { | ||||||||||||||
| // We need to check current view exist in UIManager or not | ||||||||||||||
| // Sometime, view can be replace, recycle, ... with wrong way (like FlashList) | ||||||||||||||
| // So before update, We need to check view tag exist in UIManager | ||||||||||||||
| try { | ||||||||||||||
| View view = mUIManager.resolveView(viewTag); | ||||||||||||||
| if(view == null) { | ||||||||||||||
| return; | ||||||||||||||
| } | ||||||||||||||
|
Comment on lines
+353
to
+355
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| } catch (Exception ex) { | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| Log.d("Reanimated-updateProps", "Skip update props cause viewTag not exist or have been removed!"); | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's remove this warning so that we don't pollute the logs.
Suggested change
|
||||||||||||||
| return; | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please describe in which cases the exception will be thrown? |
||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| // TODO: update PropsNode to use this method instead of its own way of updating props | ||||||||||||||
| boolean hasUIProps = false; | ||||||||||||||
| boolean hasNativeProps = false; | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rephrase this comment