Skip to content

Commit e8a3c9f

Browse files
Remove useEffect invocations
1 parent 413f11e commit e8a3c9f

File tree

5 files changed

+4
-58
lines changed

5 files changed

+4
-58
lines changed

src/components/Form/Select/Select.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {FC, useEffect} from 'react';
1+
import React, {FC} from 'react';
22
import styles from './Select.module.scss';
33
import {FormElement} from "../../../conteiners/FormElementsGenerator/FormElements/FormElement.model";
44

@@ -13,17 +13,6 @@ const Select: FC<SelectProps> = (props: SelectProps) => {
1313
const {model} = props;
1414
const options = model.metadata.split(OPTIONS_SEPARATOR)
1515

16-
useEffect(
17-
() => {
18-
console.log(`Creating [Select] component with label [${model.label}]`);
19-
20-
return () => {
21-
console.log(`Destroying [Select] component with label [${model.label}]`);
22-
};
23-
},
24-
[model.label]
25-
);
26-
2716
return (
2817
<div className={styles.Select}>
2918
<label htmlFor={model.label}>

src/components/Form/TextArea/TextArea.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {FC, useEffect} from 'react';
1+
import React, {FC} from 'react';
22
import styles from './TextArea.module.scss';
33
import {FormElement} from "../../../conteiners/FormElementsGenerator/FormElements/FormElement.model";
44

@@ -10,17 +10,6 @@ const TextArea: FC<TextAreaProps> = (props: TextAreaProps) => {
1010

1111
const {model} = props;
1212

13-
useEffect(
14-
() => {
15-
console.log(`Creating [TextArea] component with label [${model.label}]`);
16-
17-
return () => {
18-
console.log(`Destroying [TextArea] component with label [${model.label}]`);
19-
};
20-
},
21-
[model.label]
22-
);
23-
2413
return (
2514
<div className={styles.TextArea}>
2615
<label htmlFor={model.label}>{model.label}</label>

src/components/Form/TextInput/TextInput.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {FC, useEffect} from 'react';
1+
import React, {FC} from 'react';
22
import styles from './TextInput.module.scss';
33
import {FormElement} from "../../../conteiners/FormElementsGenerator/FormElements/FormElement.model";
44

@@ -10,17 +10,6 @@ const TextInput: FC<TextInputProps> = (props: TextInputProps) => {
1010

1111
const {model} = props;
1212

13-
useEffect(
14-
() => {
15-
console.log(`Creating [TextInput] component with label [${model.label}]`);
16-
17-
return () => {
18-
console.log(`Destroying [TextInput] component with label [${model.label}]`);
19-
};
20-
},
21-
[model.label]
22-
);
23-
2413
return (
2514
<div className={styles.TextInput}>
2615
<label htmlFor={model.label}>{model.label}</label>

src/components/Header/Header.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {FC, useEffect} from 'react';
1+
import React, {FC} from 'react';
22
import styles from './Header.module.scss';
33

44
export interface HeaderProps {
@@ -9,16 +9,6 @@ const Header: FC<HeaderProps> = (props: HeaderProps) => {
99

1010
const {headerText} = props;
1111

12-
useEffect(
13-
() => {
14-
console.log(`Creating [Header] component with text: ${headerText}`)
15-
return () => {
16-
console.log(`Destroying [Header] component with text: ${headerText}`);
17-
};
18-
},
19-
[headerText]
20-
);
21-
2212
return (
2313
<div className={styles.Header}>
2414
<div className={styles.headerImage}>

src/conteiners/FormElementsGenerator/FormElements/FormElements.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,6 @@ const FormElements: FC<FormElementsProperties> = (props: FormElementsProperties)
1515

1616
const {formElements, maxColumns} = props;
1717

18-
useEffect(
19-
() => {
20-
console.log(`Creating [FormElements] component`);
21-
22-
return () => {
23-
console.log('Destroying [FormElements] component');
24-
};
25-
},
26-
[]
27-
);
28-
2918
const renderFormElement = (formElement: FormElement): ReactElement => {
3019
switch (formElement.type) {
3120
case FormElementType.TEXT_INPUT:

0 commit comments

Comments
 (0)