Bläddra i källkod

set path with useEffect

kaori 4 år sedan
förälder
incheckning
9c375481b9
1 ändrade filer med 2 tillägg och 1 borttagningar
  1. 2 1
      packages/app/src/components/PageDuplicateModal.jsx

+ 2 - 1
packages/app/src/components/PageDuplicateModal.jsx

@@ -101,8 +101,9 @@ const PageDuplicateModal = (props) => {
   useEffect(() => {
   useEffect(() => {
     if (isOpened) {
     if (isOpened) {
       getSubordinatedList();
       getSubordinatedList();
+      setPageNameInput(path);
     }
     }
-  }, [isOpened, getSubordinatedList]);
+  }, [isOpened, getSubordinatedList, path]);
 
 
   function changeIsDuplicateRecursivelyWithoutExistPathHandler() {
   function changeIsDuplicateRecursivelyWithoutExistPathHandler() {
     setIsDuplicateRecursivelyWithoutExistPath(!isDuplicateRecursivelyWithoutExistPath);
     setIsDuplicateRecursivelyWithoutExistPath(!isDuplicateRecursivelyWithoutExistPath);