From 577b374804f36c068f351b40db78ddb9a8e87d3d Mon Sep 17 00:00:00 2001 From: ilong4rennes Date: Sat, 14 Dec 2024 01:19:43 +0900 Subject: [PATCH] Remove useCallback --- admin/src/Components/ProductForm.jsx | 49 +++++++++++++--------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/admin/src/Components/ProductForm.jsx b/admin/src/Components/ProductForm.jsx index c5cfe835..2c2f515a 100644 --- a/admin/src/Components/ProductForm.jsx +++ b/admin/src/Components/ProductForm.jsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect, useState } from "react"; +import React, { useEffect, useState } from "react"; import ReactSelect from "react-select"; import ProductAction, { ACTION_TYPES } from "../Models/ProductAction"; import CheckboxInput from "./CheckboxInput"; @@ -62,32 +62,29 @@ const ProductForm = ({ product, onDelete, onSave }) => { product.removeAction(action); }; - const renderAction = useCallback( - (action) => ( -
-
{action.action_type}
-
- Värde -
-
- -
-
- handleRemoveAction(action)} - > - - -
+ const renderAction = (action) => ( +
+
{action.action_type}
+
+ Värde
- ), - [], +
+ +
+
+ handleRemoveAction(action)} + > + + +
+
); const imageSrc = (o) => `data:${o.type};base64, ` + o.data;