dillon1000/react
Commit
Browse files Fix: Skip hidden inputs before text instance (#27358)
Found a hydration bug that happens when you pass a Server Action to `formAction` and the next node is a text instance. The HTML generated by Fizz is something like this: ```html <button name="$ACTION_REF_5" formAction="" formEncType="multipart/form-data" formMethod="POST"> <input type="hidden" name="$ACTION_5:0" value="..."/> <input type="hidden" name="$ACTION_5:1" value="..."/> <input type="hidden" name="$ACTION_KEY" value="..."/>Count: <!-- -->0 </button> ``` Fiber is supposed to skip over the extra hidden inputs, but it doesn't handle this correctly if the next expected node isn't a host instance. In this case, it's a text instance. Not sure if the proper fix is to change the HTML that is generated, or to change the hydration logic, but in this PR I've done the latter.
Changed paths2 files
First-parent comparisonpackages/react-dom-bindings/src/client/ReactFiberConfigDOM.js ModifiedM packages/react-dom/src/__tests__/ReactServerRenderingHydration-test.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…