From 3b551ca3f6ea9a0d13e4c4d0ac7c3f5918312d55 Mon Sep 17 00:00:00 2001 From: nimbly1 <258366730+nimbly1@users.noreply.github.com> Date: Mon, 26 Oct 2026 19:55:41 -0500 Subject: [PATCH] fix: preserve reactStrictMode when configure() omits it --- src/__tests__/config.js | 11 +++++++++++ src/config.js | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/__tests__/config.js b/src/__tests__/config.js index 7fdb1e00..739e081a 100644 --- a/src/__tests__/config.js +++ b/src/__tests__/config.js @@ -54,6 +54,17 @@ describe('configuration API', () => { expect(getConfig().reactStrictMode).toBe(true) }) + + test('configure without reactStrictMode preserves the existing value', () => { + configure({reactStrictMode: true}) + configure({testIdAttribute: 'not-data-testid'}) + + expect(getConfig().reactStrictMode).toBe(true) + + configure({reactStrictMode: false}) + + expect(getConfig().reactStrictMode).toBe(false) + }) }) test('configure can set DTL and RTL options at once', () => { diff --git a/src/config.js b/src/config.js index dc8a5035..0b038e7d 100644 --- a/src/config.js +++ b/src/config.js @@ -27,7 +27,9 @@ function configure(newConfig) { configForRTL = { ...configForRTL, - reactStrictMode, + // Only overwrite the existing value when a new one is provided, + // so calling configure() for other options keeps reactStrictMode. + reactStrictMode: reactStrictMode ?? configForRTL.reactStrictMode, } }