From fd6a1fcf8ea2e09281ebfccf08d3eb16d2527576 Mon Sep 17 00:00:00 2001 From: Manuel Schiller Date: Sat, 27 Jul 2024 17:51:40 +0200 Subject: [PATCH] tests: reproducer for #2010 --- 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 0d1e700621..6ee2c8b433 100644 --- a/packages/react-router/tests/routeContext.test.tsx +++ b/packages/react-router/tests/routeContext.test.tsx @@ -1793,6 +1793,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)}
}, })