Skip to content

Commit a2bd77c

Browse files
committed
skip: fix dependencies
1 parent dbd443b commit a2bd77c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/uikit-react-native-foundation/src/components/Image/Image.fastimage.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import _FastImage, { FastImageProps, ResizeMode, Source } from 'react-native-fast-image';
2+
import type { FastImageProps, ResizeMode, Source } from 'react-native-fast-image';
33

44
import type { SendbirdImageComponent, SendbirdImageProps } from './index';
55

@@ -46,7 +46,11 @@ function convertResizeMode(mode?: SendbirdImageProps['resizeMode']): ResizeMode
4646
}
4747
}
4848

49-
const FastImage = _FastImage as (props: FastImageProps) => JSX.Element;
49+
let FastImage: (props: FastImageProps) => JSX.Element | null = () => null;
50+
51+
try {
52+
FastImage = require('react-native-fast-image') as (props: FastImageProps) => JSX.Element;
53+
} catch {}
5054

5155
const Image_FastImage: SendbirdImageComponent = ({ source, resizeMode, onLoad, onError, style, ...props }) => {
5256
return (

packages/uikit-react-native/src/SendbirdUIKitContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const SendbirdUIKitContainer = ({
9999
sdk.addExtension('device-os-platform', SendbirdUIKit.PLATFORM);
100100
}
101101

102-
if (NetInfo) {
102+
if (NetInfo.addEventListener) {
103103
const listener = (callback: () => void, callbackType: 'online' | 'offline') => {
104104
const unsubscribe = NetInfo.addEventListener((state) => {
105105
const online = Boolean(state.isConnected) || Boolean(state.isInternetReachable);

0 commit comments

Comments
 (0)