File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
packages/webpack-plugin/lib/runtime/components/react Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ const DefaultFallback = ({ onReload }: DefaultFallbackProps) => {
8383const DefaultLoading = ( ) => {
8484 // eslint-disable-next-line @typescript-eslint/no-var-requires
8585 const FastImageModule = require ( '@d11/react-native-fast-image' )
86- const FastImage = FastImageModule && FastImageModule . default ? FastImageModule . default : FastImageModule
86+ const FastImage = FastImageModule . default || FastImageModule
8787 return (
8888 < View style = { styles . container } >
8989 < FastImage
Original file line number Diff line number Diff line change @@ -757,10 +757,12 @@ export function renderImage (
757757 imageProps : ImageProps | FastImageProps ,
758758 enableFastImage = false
759759) {
760- // eslint-disable-next-line @typescript-eslint/no-var-requires
761- const FastImageModule = enableFastImage ? require ( '@d11/react-native-fast-image' ) : null
762- const FastImage = FastImageModule && FastImageModule . default ? FastImageModule . default : FastImageModule
763- const Component : React . ComponentType < ImageProps | FastImageProps > = enableFastImage && FastImage ? FastImage : Image
760+ let Component : React . ComponentType < ImageProps | FastImageProps > = Image
761+ if ( enableFastImage ) {
762+ // eslint-disable-next-line @typescript-eslint/no-var-requires
763+ const fastImageModule = require ( '@d11/react-native-fast-image' )
764+ Component = fastImageModule . default || fastImageModule
765+ }
764766 return createElement ( Component , imageProps )
765767}
766768
You can’t perform that action at this time.
0 commit comments