Skip to content

Commit 45638d9

Browse files
author
Mitchel Severe
committed
Made methods arrow functions
1 parent f38e532 commit 45638d9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/Rectangle.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ class Rectangle extends Component<PropsInt, StateInt> {
3737
image: null,
3838
};
3939

40-
getComponentColor(componentId: number) {
40+
getComponentColor = (componentId: number) => {
4141
const color = this.props.components.find((comp: ComponentInt) => comp.id === componentId).color;
4242
return color;
4343
}
4444

45-
getPseudoChild() {
45+
getPseudoChild = () => {
4646
return this.props.components.find(
4747
(comp: ComponentInt) => comp.id === this.props.childComponentId,
4848
);
4949
}
5050

51-
handleResize(componentId: number, childId: number, target: any, blockSnapSize: number) {
51+
handleResize = (componentId: number, childId: number, target: any, blockSnapSize: number) => {
5252
let focChild: ChildInt = this.props.components
5353
.find((comp: ComponentInt) => comp.id === this.props.componentId)
5454
.children.find((child: ChildInt) => child.childId === childId);
@@ -68,7 +68,7 @@ class Rectangle extends Component<PropsInt, StateInt> {
6868
this.props.handleTransform(componentId, childId, transformation);
6969
}
7070

71-
handleDrag(componentId: number, childId: number, target: any, blockSnapSize: any) {
71+
handleDrag = (componentId: number, childId: number, target: any, blockSnapSize: any) => {
7272
const transformation = {
7373
x: Math.round(target.x() / blockSnapSize) * blockSnapSize,
7474
y: Math.round(target.y() / blockSnapSize) * blockSnapSize,

0 commit comments

Comments
 (0)