Skip to content

Commit

Permalink
tests: reproducer for #2010 (#2045)
Browse files Browse the repository at this point in the history
this was fixed in 1.49.1, keep this test to avoid future regressions
  • Loading branch information
schiller-manuel committed Aug 21, 2024
1 parent 22f0985 commit cf70c67
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react-router/tests/routeContext.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <div>{JSON.stringify(context)}</div>
},
})
Expand Down

0 comments on commit cf70c67

Please sign in to comment.