本页还没有译文
本页 16 段还没译成한국어,下面显示的是英文原文。createRoutesStub
还没翻译译自英文(reactrouter.com)本页 16 段都还没译
createRoutesStub
Framework Data
Summary
Creates a React component that renders the provided routes in a test-friendly React Router context.
Use this to unit test components that rely on router context, such as
loaderData, actionData, and route matches.
Signature
function createRoutesStub(
routes: StubRouteObject[],
_context?: RouterContextProvider,
)Params
routes
The route objects to render in the test router.
_context
An optional RouterContextProvider for supplying application context values to route middleware, loaders, and actions.
Returns
A React component that renders the test router.
AI 翻译查看英文原文