Skip to content

Commit

Permalink
tests: reproducer for #2010
Browse files Browse the repository at this point in the history
  • Loading branch information
schiller-manuel committed Jul 27, 2024
1 parent 3f6ffa5 commit fd6a1fc
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 @@ -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 <div>{JSON.stringify(context)}</div>
},
})
Expand Down

0 comments on commit fd6a1fc

Please sign in to comment.