Fix omni-view

This commit is contained in:
2026-04-20 19:53:39 +02:00
parent 4bb13739d5
commit f1112bbc8f
4 changed files with 134 additions and 115 deletions
+6 -5
View File
@@ -7,13 +7,14 @@ import { usePlayer } from "./provider";
import type { OmniPlayer } from "./specs/omni-player.nitro";
import type { Props } from "./specs/omni-view.nitro";
import type { OmniViewProps } from "./types/view";
import type { ViewStyle } from "react-native";
import { memo } from "react";
const NativeView = getHostComponent<Props, HybridViewMethods>(
"OmniView",
() => OmniConfig,
const NativeView = memo(
getHostComponent<Props, HybridViewMethods>("OmniView", () => OmniConfig),
);
export const OmniView = (props: OmniViewProps) => {
export const OmniView = memo((props: OmniViewProps & { style: ViewStyle }) => {
const player = usePlayer() as OmniPlayer;
return <NativeView player={player} {...props} />;
};
});