SkyeYoung commented on code in PR #3018:
URL: https://github.com/apache/apisix-dashboard/pull/3018#discussion_r2077057000


##########
src/components/form-slice/FormItemPlugins/PluginCardList.tsx:
##########
@@ -109,12 +118,9 @@ const PluginCardListCore = (props: PluginCardListProps) => 
{
     },
   }));
 
-  // handle state and useLocalObservable
-  useLayoutEffect(() => {
-    optionsOb.search = search.toLowerCase().trim();
-    optionsOb.plugins = plugins;
-    optionsOb.mode = mode;
-  }, [optionsOb, search, plugins, mode]);
+  useEffect(() => optionsOb.setPlugins(plugins), [optionsOb, plugins]);
+  useEffect(() => optionsOb.setSearch(search), [optionsOb, search]);
+  useEffect(() => optionsOb.setMode(mode), [optionsOb, mode]);

Review Comment:
   follow the suggestions in console.



##########
src/components/form-slice/FormSection/index.tsx:
##########
@@ -66,7 +66,7 @@ export const FormTOCBox = (props: FormTOCBoxProps) => {
   const { children, deps } = props;
   const reinitializeRef = useRef(() => {});
 
-  useDeepCompareEffect(() => {
+  useEffect(() => {
     reinitializeRef.current();
   }, [deps]);

Review Comment:
   follow the suggestions in console.



##########
src/components/form-slice/FormItemPlugins/PluginEditorDrawer.tsx:
##########
@@ -34,9 +34,9 @@ const PluginEditorDrawerCore = (props: 
PluginEditorDrawerProps) => {
     methods.reset();
   };
 
-  useDeepCompareEffect(() => {
+  useEffect(() => {
     methods.setValue('config', toConfigStr(config));
-  }, [config]);
+  }, [config, methods]);

Review Comment:
   follow the suggestions.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to