From 691c7c9742ecdc9a08db6e3b300417f9e3f51138 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Mon, 12 Dec 2022 15:25:31 -0500 Subject: [PATCH] Fix up memoization of useTransition --- integration/rendering-test.ts | 1 - integration/transition-state-test.ts | 6 +----- packages/remix-react/components.tsx | 21 +++++++++++++++++---- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/integration/rendering-test.ts b/integration/rendering-test.ts index 61a5e3b2a18..6a780aaf2b1 100644 --- a/integration/rendering-test.ts +++ b/integration/rendering-test.ts @@ -9,7 +9,6 @@ test.describe("rendering", () => { let appFixture: AppFixture; test.beforeAll(async () => { - process.env.NODE_ENV = "development"; fixture = await createFixture({ files: { "app/root.jsx": js` diff --git a/integration/transition-state-test.ts b/integration/transition-state-test.ts index b5037f4cf85..c0d166bc333 100644 --- a/integration/transition-state-test.ts +++ b/integration/transition-state-test.ts @@ -32,11 +32,6 @@ test.describe("rendering", () => { export default function() { const transition = useTransition(); - // TODO: This seems to have some issues with StrictMode? - // - Passes running only transition tests w/StrictMode - // - Passes on full suite with fullyParallel:false w/StrictMode - // - Fails on full suite with fullyParallel:true w/StrictMode - // - Passes on full suite with fullyParallel:true w/o StrictMode const transitionsRef = useRef(); const transitions = useMemo(() => { const savedTransitions = transitionsRef.current || []; @@ -47,6 +42,7 @@ test.describe("rendering", () => { return ( + Test {transition.state != "idle" && ( diff --git a/packages/remix-react/components.tsx b/packages/remix-react/components.tsx index c76e2dd38a6..5dfb9e2b478 100644 --- a/packages/remix-react/components.tsx +++ b/packages/remix-react/components.tsx @@ -796,6 +796,7 @@ import(${JSON.stringify(manifest.entry.module)});`; />