-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
[RFC] Rename AppProvider
export for Next.js and react-router integrations
#4319
Comments
thank you, can you add a proposal for the new names under the options section? When we reach consensus, would you be interested in contributing this change? |
AppProvider
export for Next.js and react-router integrations
One option that I considered before and thought about bringing up for consideration again was to export a hook to create the router with React Router, to be passed as a prop to the standard Besides that or a possible rename, we can also consider exporting all the types from the standard |
My idea is to add a type declaration file called "AppProviderTypes.ts", export it globally and remove the "AppProvider" export at the same time, but the changes are huge. Or add "AppProviderComponent.ts", keep the types in "AppProvider.ts", that would be a better idea. |
I think we eventually want to be able to do more in the next.js app provider than just routing. A hook may be a bit limited in that sense? I'm not sure it's a good idea to export the same interfaces from multiple places (barrel filles excluded). We don't do that anywhere, it could become confusing. I think renaming it to something like |
For the Next.js AppProvider that's probably true, but for the React Router integration I wasn't so sure.
Ok, I was thinking about something like
Ok, we can keep types as they are for now, the renaming would already help reduce the confusion. |
we lately created a new project with the toolpad and mistakenly imported the AppProvider from the wrong url, this was vaery hard to find out! each time we navigated between routes in the sidebar the app reloaded instead smoothly navigation |
Note: make sure we also solve the confusion in #4513 with this. |
What's the problem?
I followed the example and found the example fails (keep refresh the whole page when click the nested links) when import the "AppProvider" with
but works when use
It's very confusing with the same name export but actual different. And not type 'Navigation' found of the 'core-vite' example line:
What are the requirements?
No response
What are our options?
Rename the export name and mention it in the documentation would be perfect.
Proposed solution
No response
Resources and benchmarks
No response
Search keywords:
The text was updated successfully, but these errors were encountered: