Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(react-router): remove leftover remix references #12544

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,4 @@
- yuleicul
- zeromask1337
- zheng-chuang
- AlemTuzlak
14 changes: 7 additions & 7 deletions packages/react-router/lib/dom/ssr/routes-test-stub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ export function createRoutesStub(
future,
}: RoutesTestStubProps) {
let routerRef = React.useRef<ReturnType<typeof createMemoryRouter>>();
let remixContextRef = React.useRef<FrameworkContextObject>();
let reactRouterContextRef = React.useRef<FrameworkContextObject>();
AlemTuzlak marked this conversation as resolved.
Show resolved Hide resolved

if (routerRef.current == null) {
remixContextRef.current = {
reactRouterContextRef.current = {
AlemTuzlak marked this conversation as resolved.
Show resolved Hide resolved
future: {},
manifest: {
routes: {},
Expand All @@ -121,8 +121,8 @@ export function createRoutesStub(
// @ts-expect-error loader/action context types don't match :/
convertRoutesToDataRoutes(routes, (r) => r),
context,
remixContextRef.current.manifest,
remixContextRef.current.routeModules
reactRouterContextRef.current.manifest,
reactRouterContextRef.current.routeModules
AlemTuzlak marked this conversation as resolved.
Show resolved Hide resolved
);
routerRef.current = createMemoryRouter(patched, {
initialEntries,
Expand All @@ -132,7 +132,7 @@ export function createRoutesStub(
}

return (
<FrameworkContext.Provider value={remixContextRef.current}>
<FrameworkContext.Provider value={reactRouterContextRef.current}>
AlemTuzlak marked this conversation as resolved.
Show resolved Hide resolved
<RouterProvider router={routerRef.current} />
</FrameworkContext.Provider>
);
Expand All @@ -149,11 +149,11 @@ function processRoutes(
return routes.map((route) => {
if (!route.id) {
throw new Error(
"Expected a route.id in @remix-run/testing processRoutes() function"
"Expected a route.id in react-router processRoutes() function"
);
}

// Patch in the Remix context to loaders/actions
// Patch in the react-router context to loaders/actions
let { loader, action } = route;
let newRoute: DataRouteObject = {
id: route.id,
Expand Down
Loading