Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Conversation

@lei9444
Copy link
Contributor

@lei9444 lei9444 commented Jan 6, 2021

Description

Root cause

  1. when updating the dialog data, the state of dialogs in recoil will trigger one re-render. But in the the local state currentDialog will listen to the dialogs in useEffect and then trigger another re-render. The has the same issue.
    image

  2. The debouncedUpdateLgTemplate API used by inline editor will invoke on the leading edge and trailing edge. This may trigger twice re-render.
    image

Task Item

refs #minor

Screenshots

image

@coveralls
Copy link

coveralls commented Jan 6, 2021

Coverage Status

Coverage decreased (-0.007%) to 54.794% when pulling 86f0440 on lei9444:re-render into 99fbf96 on microsoft:main.

boydc2014
boydc2014 previously approved these changes Jan 6, 2021
Copy link
Contributor

@a-b-r-o-w-n a-b-r-o-w-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lei9444 make sure to test the changes the debounce on the lg and lu api thoroughly.

@a-b-r-o-w-n a-b-r-o-w-n self-assigned this Jan 6, 2021
@a-b-r-o-w-n
Copy link
Contributor

@lei9444 ping me when you feel confident with the LG/LU api update -- I'll approve it.

@lei9444
Copy link
Contributor Author

lei9444 commented Jan 8, 2021

@lei9444 ping me when you feel confident with the LG/LU api update -- I'll approve it.

Thanks @a-b-r-o-w-n ,I have repro it. when we use the { leading: true, trailing: false }, we may drop some characters. I found you update trailing to true in #4790. And I have tested my PR, it's OK

@boydc2014 boydc2014 merged commit 9e1f515 into microsoft:main Jan 11, 2021
@lei9444 lei9444 deleted the re-render branch February 1, 2021 02:06
@boydc2014 boydc2014 mentioned this pull request Feb 2, 2021
lei9444 added a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
* fix: mutli re-render when editing in form editor

* make the useEffect more efficient

Co-authored-by: Dong Lei <donglei@microsoft.com>
Co-authored-by: Andy Brown <asbrown002@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants