Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Commit b0e46d8

Browse files
committed
Remove prop-types
1 parent b3dd91f commit b0e46d8

File tree

4 files changed

+2
-27
lines changed

4 files changed

+2
-27
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"buffer": "^5.0.8",
5151
"crypto-js": "^3.1.9-1",
5252
"path": "^0.12.7",
53-
"prop-types": "^15.6.0",
5453
"react-native-uuid": "^1.4.9",
5554
"rxjs": "^6.6.0",
5655
"traverse": "^0.6.6",

src/index.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
// Load dependencies.
1717
import React, { ReactNode } from 'react'
18-
import PropTypes from 'prop-types'
1918
import FileSystemFactory, { CacheFileInfo, FileSystem } from './FileSystem'
2019
import traverse from 'traverse'
2120
import validator from 'validator'
@@ -39,12 +38,10 @@ export interface OnLoadEvent {
3938

4039
export interface ReactNativeImageCacheHocProps {
4140
source?: Source
42-
4341
onLoadFinished?(event: OnLoadEvent): void
44-
4542
style?: StyleProp<ImageStyle>
46-
4743
placeholder?: ReactNode
44+
fileHostWhitelist?: string[]
4845
}
4946

5047
export interface ReactNativeImageCacheHocState {
@@ -85,14 +82,6 @@ const imageCacheHoc = <P extends object>(
8582
P & ReactNativeImageCacheHocProps,
8683
ReactNativeImageCacheHocState
8784
> {
88-
static propTypes = {
89-
fileHostWhitelist: PropTypes.array,
90-
source: PropTypes.object.isRequired,
91-
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
92-
placeholder: PropTypes.element,
93-
onLoadFinished: PropTypes.func,
94-
}
95-
9685
componentId: any
9786
unmounted$: BehaviorSubject<boolean>
9887
options: Required<ReactNativeImageCacheHocOptions>

tests/CacheableImage.test.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,6 @@ describe('CacheableImage', function () {
6969
cacheableImage.options.should.have.properties(validOptions)
7070
})
7171

72-
it('Component property type validation should exist.', () => {
73-
const CacheableImage = imageCacheHoc(Image)
74-
75-
// eslint-disable-next-line react/forbid-foreign-prop-types
76-
Object.keys(CacheableImage.propTypes).should.deepEqual([
77-
'fileHostWhitelist',
78-
'source',
79-
'style',
80-
'placeholder',
81-
'onLoadFinished',
82-
])
83-
})
84-
8572
it('#cacheFile static method should work as expected for cache dir files.', () => {
8673
const CacheableImage = imageCacheHoc(Image)
8774

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10233,7 +10233,7 @@ prop-types-exact@^1.2.0:
1023310233
object.assign "^4.1.0"
1023410234
reflect.ownkeys "^0.2.0"
1023510235

10236-
prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2:
10236+
prop-types@^15.6.2, prop-types@^15.7.2:
1023710237
version "15.7.2"
1023810238
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
1023910239
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==

0 commit comments

Comments
 (0)