Skip to content

Commit

Permalink
fix(android): update custom createVirtualNode arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
siguangli2018 authored and siguangli committed Nov 26, 2024
1 parent f993ed7 commit 2618ae7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,9 @@ public VirtualNode createVirtualNode(int rootId, int id, int pid, int index,
@NonNull String className,
@Nullable Map<String, Object> props) {
HippyViewController<?> controller = mControllerRegistry.getViewController(className);
if (controller != null) {
return controller.createVirtualNode(rootId, id, pid, index, props);
Renderer renderer = mRendererWeakRef.get();
if (controller != null && renderer instanceof NativeRender) {
return controller.createVirtualNode(rootId, id, pid, index, props, (NativeRender) renderer);
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ protected RenderNode createRenderNode(int rootId, int id, @Nullable Map<String,
@SuppressWarnings("unused")
@Nullable
public VirtualNode createVirtualNode(int rootId, int id, int pid, int index,
@Nullable Map<String, Object> props) {
@Nullable Map<String, Object> props, @NonNull NativeRender nativeRender) {
// The host can create customize virtual node in a derived class.
return null;
}
Expand Down

0 comments on commit 2618ae7

Please sign in to comment.