mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-05 13:46:59 +00:00
Fix omni-view
This commit is contained in:
+6
-5
@@ -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} />;
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user