Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion android/src/main/java/com/swmansion/reanimated/NodesManager.java
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;
Expand Down Expand Up @@ -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
Comment on lines +348 to +350
Copy link
Member

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

try {
View view = mUIManager.resolveView(viewTag);
if(view == null) {
return;
}
Comment on lines +353 to +355
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if(view == null) {
return;
}
if (view == null) {
return;
}

} catch (Exception ex) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
} catch (Exception ex) {
} catch (Exception e) {

Log.d("Reanimated-updateProps", "Skip update props cause viewTag not exist or have been removed!");
Copy link
Member

Choose a reason for hiding this comment

The 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
Log.d("Reanimated-updateProps", "Skip update props cause viewTag not exist or have been removed!");

return;
Copy link
Member

Choose a reason for hiding this comment

The 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;
Expand Down