dillon1000/react
Commit
Browse files Trigger a proper no-op warning for async state changes on server (#7127)
This commit fixes #5473: ReactDOMServer.renderToString: presence of onClick handler causes errors on async update This commit performs the following changes: - Adds a getUpdateQueue method to ReactServerRenderingTransaction, ReactReconcileTransaction, ReactNativeReconcileTransaction and ReactTestReconcileTransaction - Make the ReactCompositeComponent call this getUpdateQueue instead of using ReactUpdateQueue that was unwanted at certain moments on server - On ReactServerRenderingTransaction, dispatch ReactUpdateQueue's methods while rendering and warning methods afterwards. This is done through the new ReactServerUpdateQueue class - Added a series of tests that mimics the case presented in #5473 with setState, forceUpdate and replaceState - Add flow typechecking on concerned files
Changed paths8 files
First-parent comparisonsrc/isomorphic/modern/class/ReactNoopUpdateQueue.js ModifiedM src/renderers/dom/client/ReactReconcileTransaction.js ModifiedM src/renderers/dom/server/ReactServerRenderingTransaction.js ModifiedA src/renderers/dom/server/ReactServerUpdateQueue.js AddedM src/renderers/dom/server/__tests__/ReactServerRendering-test.js ModifiedM src/renderers/native/ReactNativeReconcileTransaction.js ModifiedM src/renderers/shared/stack/reconciler/ReactCompositeComponent.js ModifiedM src/renderers/testing/ReactTestReconcileTransaction.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…