You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by sh...@apache.org on 2024/01/18 08:26:55 UTC

(incubator-answer) branch dev updated: fix: the answer's content in edit answer page disappears (#715)

This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git


The following commit(s) were added to refs/heads/dev by this push:
     new 1b1c994a fix: the answer's content in edit answer page disappears (#715)
1b1c994a is described below

commit 1b1c994a22651ffe8f2623a664cf247cc3e1b2e8
Author: Han Gao <dh...@hotmail.com>
AuthorDate: Thu Jan 18 16:26:50 2024 +0800

    fix: the answer's content in edit answer page disappears (#715)
    
    fix #713 .
    
    After changing to `useEffect`, the issue was resolved. I don't know why
    we use `useLayoutEffect`. Pls let me know if something I missed.
---
 ui/src/pages/Questions/EditAnswer/index.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui/src/pages/Questions/EditAnswer/index.tsx b/ui/src/pages/Questions/EditAnswer/index.tsx
index d693794d..9cf5d8d7 100644
--- a/ui/src/pages/Questions/EditAnswer/index.tsx
+++ b/ui/src/pages/Questions/EditAnswer/index.tsx
@@ -73,7 +73,7 @@ const Index = () => {
   const [contentChanged, setContentChanged] = useState(false);
   const editCaptcha = useCaptchaModal('edit');
 
-  useLayoutEffect(() => {
+  useEffect(() => {
     if (data?.info?.content) {
       setFormData({
         ...formData,