14
14
*/
15
15
16
16
// Load dependencies.
17
- import React from 'react'
17
+ import React , { ReactNode } from 'react'
18
18
import PropTypes from 'prop-types'
19
19
import FileSystemFactory , { CacheFileInfo , FileSystem } from './FileSystem'
20
20
import traverse from 'traverse'
@@ -43,7 +43,7 @@ export interface ReactNativeImageCacheHocProps {
43
43
44
44
style ?: StyleProp < ImageStyle >
45
45
46
- placeholder ?: JSX . Element
46
+ placeholder ?: ReactNode
47
47
}
48
48
49
49
export interface ReactNativeImageCacheHocState {
@@ -56,7 +56,7 @@ export interface ReactNativeImageCacheHocOptions {
56
56
fileHostWhitelist ?: string [ ]
57
57
cachePruneTriggerLimit ?: number // Maximum size of image file cache in bytes before pruning occurs. Defaults to 15 MB.
58
58
fileDirName ?: string | null // Namespace local file writing to this directory. Defaults to 'react-native-image-cache-hoc'.
59
- defaultPlaceholder ?: JSX . Element | null
59
+ defaultPlaceholder ?: ReactNode | null
60
60
}
61
61
62
62
const imageCacheHoc = < P extends object > (
@@ -77,7 +77,7 @@ const imageCacheHoc = <P extends object>(
77
77
throw new Error ( 'fileDirName option must be string' )
78
78
}
79
79
if ( options . defaultPlaceholder && typeof options . defaultPlaceholder !== 'object' ) {
80
- throw new Error ( 'defaultPlaceholder option must be a JSX.Element ' )
80
+ throw new Error ( 'defaultPlaceholder option must be a ReactNode ' )
81
81
}
82
82
83
83
return class extends React . PureComponent <
0 commit comments