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

Commit 71de384

Browse files
committed
Updating HOC to return PureComponent instead of Component for performance boost.
Incrementing minor version.
1 parent 5bca7d2 commit 71de384

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/imageCacheHoc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default function imageCacheHoc(Image, options = {}) {
3232
if (options.fileDirName && typeof options.fileDirName !== 'string') { throw new Error('fileDirName option must be string'); }
3333
if (options.defaultPlaceholder && (!options.defaultPlaceholder.component || !options.defaultPlaceholder.props)) { throw new Error('defaultPlaceholder option object must include "component" and "props" properties (props can be an empty object)'); }
3434

35-
return class extends React.Component {
35+
return class extends React.PureComponent {
3636

3737
static propTypes = {
3838
fileHostWhitelist: PropTypes.array,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-image-cache-hoc",
3-
"version": "1.3.1",
3+
"version": "1.4.0",
44
"description": "React Native Higher Order Component that adds advanced caching functionality to the react native Image component.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)