|
@@ -1,5 +1,5 @@
|
|
|
import React, {
|
|
import React, {
|
|
|
- useCallback, useState, FC, useEffect,
|
|
|
|
|
|
|
+ useCallback, useState, FC, useEffect, memo,
|
|
|
} from 'react';
|
|
} from 'react';
|
|
|
import nodePath from 'path';
|
|
import nodePath from 'path';
|
|
|
|
|
|
|
@@ -25,7 +25,11 @@ const markTarget = (children: ItemNode[], targetId: string): void => {
|
|
|
return;
|
|
return;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const ItemContol: FC = () => {
|
|
|
|
|
|
|
+const ItemContol: FC = memo(() => {
|
|
|
|
|
+ const onClickHandler = useCallback((e) => {
|
|
|
|
|
+ console.log('Clicked!');
|
|
|
|
|
+ }, []);
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
<button
|
|
<button
|
|
@@ -39,12 +43,13 @@ const ItemContol: FC = () => {
|
|
|
type="button"
|
|
type="button"
|
|
|
className="btn-link nav-link dropdown-toggle dropdown-toggle-no-caret border-0 rounded grw-btn-page-management py-0"
|
|
className="btn-link nav-link dropdown-toggle dropdown-toggle-no-caret border-0 rounded grw-btn-page-management py-0"
|
|
|
data-toggle="dropdown"
|
|
data-toggle="dropdown"
|
|
|
|
|
+ onClick={onClickHandler}
|
|
|
>
|
|
>
|
|
|
<i className="fa fa-plus-circle text-muted"></i>
|
|
<i className="fa fa-plus-circle text-muted"></i>
|
|
|
</button>
|
|
</button>
|
|
|
</>
|
|
</>
|
|
|
);
|
|
);
|
|
|
-};
|
|
|
|
|
|
|
+});
|
|
|
|
|
|
|
|
const ItemCount: FC = () => {
|
|
const ItemCount: FC = () => {
|
|
|
return (
|
|
return (
|