-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[examples] Use material-nextjs integration package #40199
[examples] Use material-nextjs integration package #40199
Conversation
siriwatknp
commented
Dec 13, 2023
- I have followed (at least) the PR section of the contributing guide.
Netlify deploy previewhttps://deploy-preview-40199--material-ui.netlify.app/ Bundle size report |
This comment was marked as resolved.
This comment was marked as resolved.
@@ -1,23 +1,15 @@ | |||
import * as React from 'react'; | |||
import Head from 'next/head'; | |||
import { AppProps } from 'next/app'; | |||
import { AppCacheProvider } from '@mui/material-nextjs/v14-pagesRouter'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies if I'm missing something, but why do we have these versioned paths (v13-*
and v14-*
)? It looks like v14-
just re-exports everything from v13-
so wondering if there's a reason we couldn't have @mui/material-nextjs/pagesRouter
and @mui/material-nextjs/appRouter
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the question. It's the versioning flexibility for us to maintain. If Nextjs releases a new major (e.g. v15) with breaking changes but Material UI is still in v5, we still have room to create a new integration with Nextjs v15 and people can just bump the material-nextjs
version and switch to v15-*
APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For developers, they just need to use material-nextjs
with the same version as Material UI and import the integration from the folder that matches your Nextjs version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can not find a module or declarations for
import { AppRouterCacheProvider } from '@mui/material-nextjs/v14-appRouter';
That works
import { AppRouterCacheProvider } from '@mui/material-nextjs/build/v14-appRouter';
Opps, for got to add |
I'm getting a hydration mismatch in the v4-v5 migration example:
All of the others seem to be working correctly. |
This is not related to the changes but due to Next.js 14. I pushed a fix in 96bbe2d |