Skip to content

Commit 262ddf9

Browse files
committed
Replace Components with PureComponents for performance boost.
1 parent 8f94887 commit 262ddf9

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/ImageCell/CustomImageUnit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Component } from "react";
1+
import { PureComponent } from "react";
22
import PropTypes from "prop-types";
33

4-
export default class CustomImageUnit extends Component {
4+
export default class CustomImageUnit extends PureComponent {
55
static propTypes = {
66
data: PropTypes.object.isRequired,
77
source: PropTypes.any.isRequired,

src/ImageCell/ImageComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import React, { Component } from "react";
1+
import React, { PureComponent } from "react";
22
import {
33
Image
44
} from "react-native";
55
import PropTypes from "prop-types";
66
import Injector from "./Injector";
77

8-
export default class ImageComponent extends Component {
8+
export default class ImageComponent extends PureComponent {
99
static propTypes = {
1010
width: PropTypes.number.isRequired,
1111
height: PropTypes.number.isRequired,

src/ImageCell/Injector.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React, { Component } from "react";
1+
import React, { PureComponent } from "react";
22
import PropTypes from "prop-types";
33

4-
export default class Injector extends Component {
4+
export default class Injector extends PureComponent {
55
static propTypes = {
66
defaultComponent: PropTypes.func,
77
defaultProps: PropTypes.object,

src/ImageCell/TouchableImageComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import React, { Component } from "react";
1+
import React, { PureComponent } from "react";
22
import {
33
TouchableOpacity
44
} from "react-native";
55
import PropTypes from "prop-types";
66
import ImageComponent from "./ImageComponent";
77

8-
export default class TouchableImageComponent extends Component {
8+
export default class TouchableImageComponent extends PureComponent {
99
static propTypes = {
1010
data: PropTypes.object.isRequired,
1111
source: PropTypes.any.isRequired,

src/ImageCell/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Component } from "react";
1+
import React, { PureComponent } from "react";
22
import {
33
View
44
} from "react-native";
@@ -7,7 +7,7 @@ import ImageComponent from "./ImageComponent";
77
import TouchableImageComponent from "./TouchableImageComponent";
88
import CustomImageUnit from "./CustomImageUnit";
99

10-
export default class ImageCell extends Component {
10+
export default class ImageCell extends PureComponent {
1111
static propTypes = {
1212
data: PropTypes.object.isRequired,
1313
source: PropTypes.any.isRequired,

0 commit comments

Comments
 (0)