fix(android): update custom createVirtualNode arguments

This commit is contained in:
maxli
2025-02-14 11:35:56 +08:00
committed by siguangli
parent 58c82072cc
commit c095855b10
2 changed files with 4 additions and 3 deletions
@@ -442,8 +442,9 @@ public class ControllerManager {
@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;
}
@@ -400,7 +400,7 @@ public abstract class HippyViewController<T extends View & HippyViewBase> implem
@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;
}