From 9a46b861499dc67f6d74ba536a34ffc6df9ae4b1 Mon Sep 17 00:00:00 2001 From: erikras-dinesh-agent Date: Tue, 17 Feb 2026 04:32:53 +0100 Subject: [PATCH] Test: regression test for nested Field with validator infinite loop (#914) --- src/ReactFinalForm.test.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/ReactFinalForm.test.js b/src/ReactFinalForm.test.js index 5b6c575..b162bbb 100644 --- a/src/ReactFinalForm.test.js +++ b/src/ReactFinalForm.test.js @@ -991,3 +991,33 @@ describe("ReactFinalForm", () => { expect(getByTestId("password").value).toBe("f1nal-f0rm-RULEZ"); }); }); + +describe("Issue #914 – nested Field with validator causing Maximum update depth", () => { + it("should not throw Maximum update depth exceeded when nesting Fields with validators", () => { + // https://github.com/final-form/react-final-form/issues/914 + const required = (value) => (value ? undefined : "Required"); + + expect(() => { + render( +
+ {({ handleSubmit }) => ( + + + {({ input }) => ( +
+ + + {({ input: innerInput }) => ( + + )} + +
+ )} +
+
+ )} + , + ); + }).not.toThrow(); + }); +});