refinedev / refine

A React Framework for building internal tools, admin panels, dashboards & B2B apps with unmatched flexibility.
https://refine.dev
MIT License
27.46k stars 2.13k forks source link

[FEAT] `@refinedev/nextjs-router` and others should allow configuration #6308

Open datner opened 1 week ago

datner commented 1 week ago

Is your feature request related to a problem? Please describe.

Trying to use refine without material ui or antd or anything of the sort for personal taste reasons (and a big reason why I adopted refine). But I found it quite difficult to actually develop a proper customized solution on the most surface level.. For example it is impossible to sufficiently customize the AuthPage without swizzling, but doing the same for the Link of the routerProvider is plain impossible in conventional methods 🤷🏻‍♂️

Describe alternatives you've considered

import routerProvider from "@refinedev/nextjs-router";
import {MyLink} from "@components/my-link";

routerProvider.Link = MyLink as any

Additional context

No response

Describe the thing to improve

makeProvider({...})
aliemir commented 3 days ago

Hey @datner, Refine expects provider props to be objects with certain properties. Simply by overriding the Link property, you can configure routerProvider to use your <Link /> component. In its type definition, we expect Link to forward the ref and allow a to prop for href. If your component complies with those requirements then you should not need marking it as any to use.

I think having something like makeProvider is worth discussing but I'm more curious about why you needed marking it as any and what errors did you had before that, can you give us a small reproducible example or some code to share? 🙏