Skip to content

Conversation

sebmarkbage
Copy link
Collaborator

requestFormReset incorrectly tries to get the current dispatch queue from the Fiber. However, the Fiber might be the workInProgress which is an inconsistent state.

This hack just tries the other Fiber if it detects one of the known inconsistent states but there can be more.

Really we should stash the dispatch queue somewhere stateful which is effectively what setState does by binding it to the closure.

@react-sizebot
Copy link

Comparing: 0038c50...bbe62ec

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js +0.02% 527.72 kB 527.81 kB +0.02% 93.07 kB 93.08 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js +0.02% 633.34 kB 633.44 kB +0.02% 111.25 kB 111.27 kB
facebook-www/ReactDOM-prod.classic.js +0.01% 671.13 kB 671.22 kB = 117.70 kB 117.71 kB
facebook-www/ReactDOM-prod.modern.js +0.01% 661.41 kB 661.50 kB = 116.14 kB 116.15 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against bbe62ec

const newResetState = {};
if (stateHook.next === null) {
// Hack alert. If formFiber is the workInProgress Fiber then
Copy link
Member

Choose a reason for hiding this comment

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

image

@sebmarkbage sebmarkbage merged commit 88b9767 into facebook:main Apr 29, 2025
245 checks passed
@ryanflorence
Copy link
Contributor

🙏

github-actions bot pushed a commit that referenced this pull request Apr 29, 2025
`requestFormReset` incorrectly tries to get the current dispatch queue
from the Fiber. However, the Fiber might be the workInProgress which is
an inconsistent state.

This hack just tries the other Fiber if it detects one of the known
inconsistent states but there can be more.

Really we should stash the dispatch queue somewhere stateful which is
effectively what `setState` does by binding it to the closure.

DiffTrain build for [88b9767](88b9767)
github-actions bot pushed a commit that referenced this pull request Apr 29, 2025
`requestFormReset` incorrectly tries to get the current dispatch queue
from the Fiber. However, the Fiber might be the workInProgress which is
an inconsistent state.

This hack just tries the other Fiber if it detects one of the known
inconsistent states but there can be more.

Really we should stash the dispatch queue somewhere stateful which is
effectively what `setState` does by binding it to the closure.

DiffTrain build for [88b9767](88b9767)
mattcarrollcode added a commit that referenced this pull request May 5, 2025
github-actions bot pushed a commit that referenced this pull request May 5, 2025
github-actions bot pushed a commit to code/lib-react that referenced this pull request May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants