like-gold
like-gold15mo ago

Remix have deprecated the nested folders route convention for flat routes.

I attempted to follow the switch to v2_routeConvention for remix, however routing works, except for the dashboard page, where / should route to /dashboard. DEPRECATED: The old nested folders route convention has been deprecated in favor of "flat routes". Please enable the new routing convention via the future.v2_routeConvention flag in your remix.config.js file. For more information, please see https://remix.run/docs/en/main/file-conventions/route-files-v2
future: { v2_routeConvention: true, },
future: { v2_routeConvention: true, },
Added above to remix.conf.js. Is there a recommended solution for this?
4 Replies
kapa.ai
kapa.ai15mo ago
Hey @Devious! I'm the kapa.ai support bot. I've searched through the docs to try to answer your question. :wave: ---------------------- It looks like you have enabled the new routing convention via the future.v2_routeConvention flag in your remix.config.js file. However, the root / route is not handled by the splat route in Remix. To redirect to the DashboardPage for the root / route, you should create a index.tsx file in the app/routes directory and export the RemixRouteComponent in it, binding the initialRoute property to /dashboard. For example:
import { RemixRouteComponent } from "@pankod/refine-remix-router";

export default RemixRouteComponent.bind({ initialRoute: "/dashboard" });
import { RemixRouteComponent } from "@pankod/refine-remix-router";

export default RemixRouteComponent.bind({ initialRoute: "/dashboard" });
For more information, please see the Router Provider (https://refine.dev/docs/core/providers/router-provider) documentation. ----------------------
kapa.ai
kapa.ai15mo ago
<@333996895850594305> kapa.ai is still learning and improving, please let us how it did by reacting below
Omer
Omer15mo ago
Hey @Devious , Could you check the new Remix Router doc? ⚡ https://refine.dev/docs/packages/documentation/routers/remix/
Remix | refine
refine provides router bindings and utilities for Remix. This package will provide easy integration between refine and Remix for both existing projects and new projects without giving up the benefits of Remix.
like-gold
like-gold15mo ago
Yeah, I have had a look. There is a bunch of stuff I can't get working in the new router. I think the change to having to define routes is a bit frustrating. But I need to spend some more time with it