-
Notifications
You must be signed in to change notification settings - Fork 45.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ReactAct flushActQueue
error handler
#24175
Conversation
Hi @dev-itsheng! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Comparing: e7d0053...a2bd5a8 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
…ng/react into patch-packages/react-1 � Conflicts: � packages/react/src/__tests__/ReactAct.test.js
There seems to be a problem, wait for me to fix it. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated. |
Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you! |
Summary
When I read React's code, I noticed a detail:
Note the line
queue = queue.slice(i + 1);
, which reassigns the parameters in the function. Obviously, this sentence does not work, and the actual "queue" will remain unchanged. .To achieve the actual effect, there are two methods. The first is to use a method that can modify the value of the array itself, such as
queue.splice(0, i + 1)
. The second is to directly modify the pointer ofqueue
, that isReactCurrentActQueue.current
, I used the second method.How did you test this change?
I noticed that for
ReactAct.js
, there is no corresponding test file in the__tests__
folder, so I added one and tested indirectly through theact
function exported by this file.However, due to my environment issues, the tests were not successfully executed locally. The specific reasons are still to be seen, but I decided to commit first, and then use GitHub's CI to check whether the changes took effect.
If the results are not correct, I will continue to improve my code.
Also, there is a small problem, I noticed that there is an
AUTHORS
file in the root directory of the project, do I need to add this manually?