From cf70c677f42cc435d0b7d7955a68876681855335 Mon Sep 17 00:00:00 2001 From: Manuel Schiller Date: Wed, 21 Aug 2024 19:55:03 +0200 Subject: [PATCH] tests: reproducer for #2010 (#2045) this was fixed in 1.49.1, keep this test to avoid future regressions --- packages/react-router/tests/routeContext.test.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-router/tests/routeContext.test.tsx b/packages/react-router/tests/routeContext.test.tsx index 40b4294ee9..adcd404831 100644 --- a/packages/react-router/tests/routeContext.test.tsx +++ b/packages/react-router/tests/routeContext.test.tsx @@ -2123,6 +2123,10 @@ describe('useRouteContext in the component', () => { path: '/', component: () => { const context = indexRoute.useRouteContext() + // eslint-disable-next-line ts/no-unnecessary-condition + if (context === undefined) { + throw new Error('context is undefined') + } return
{JSON.stringify(context)}
}, })