Skip to content

Commit

Permalink
Bump Next.js to 15 and React to 19
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoAndai committed Dec 24, 2024
1 parent 9d29815 commit 28c97e6
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 77 deletions.
5 changes: 0 additions & 5 deletions examples/material-ui-nextjs-pages-router-ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ If you prefer, you can [use styled-components instead](https://mui.com/material-
The [example folder](https://github.com/mui/material-ui/tree/HEAD/examples/material-ui-nextjs-pages-router-ts) provides an adapter for the use of [Next.js's Link component](https://nextjs.org/docs/pages/api-reference/components/link) with Material UI.
More information [in the documentation](https://mui.com/material-ui/integrations/routing/#next-js-pages-router).

## Upgrading to Next.js 15

This example uses Next.js 14.
To upgrade to version 15, please follow the [official upgrade guide](https://nextjs.org/docs/app/building-your-application/upgrading/version-15) in the Next.js docs.

## What's next?

<!-- #default-branch-switch -->
Expand Down
10 changes: 5 additions & 5 deletions examples/material-ui-nextjs-pages-router-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
"@mui/material": "latest",
"@mui/material-nextjs": "latest",
"clsx": "latest",
"next": "^14.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"next": "^15.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@types/node": "latest",
"@types/react": "latest",
"@types/react": "^19.0.0",
"eslint": "latest",
"eslint-config-next": "^14.0.0",
"eslint-config-next": "^15.0.0",
"typescript": "latest"
}
}
5 changes: 0 additions & 5 deletions examples/material-ui-nextjs-pages-router/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ If you prefer, you can [use styled-components instead](https://mui.com/material-
The [example folder](https://github.com/mui/material-ui/tree/HEAD/examples/material-ui-nextjs-pages-router) provides an adapter for the use of [Next.js's Link component](https://nextjs.org/docs/pages/api-reference/components/link) with Material UI.
More information [in the documentation](https://mui.com/material-ui/integrations/routing/#next-js-pages-router).

## Upgrading to Next.js 15

This example uses Next.js 14.
To upgrade to version 15, please follow the [official upgrade guide](https://nextjs.org/docs/app/building-your-application/upgrading/version-15) in the Next.js docs.

## What's next?

<!-- #default-branch-switch -->
Expand Down
9 changes: 4 additions & 5 deletions examples/material-ui-nextjs-pages-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@
"@mui/material": "latest",
"@mui/material-nextjs": "latest",
"clsx": "latest",
"next": "^14.0.0",
"prop-types": "latest",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"next": "^15.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"eslint": "latest",
"eslint-config-next": "^14.0.0"
"eslint-config-next": "^15.0.0"
}
}
6 changes: 0 additions & 6 deletions examples/material-ui-nextjs-pages-router/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import Head from 'next/head';
import { AppCacheProvider } from '@mui/material-nextjs/v14-pagesRouter';
import { ThemeProvider } from '@mui/material/styles';
Expand All @@ -22,8 +21,3 @@ export default function MyApp(props) {
</AppCacheProvider>
);
}

MyApp.propTypes = {
Component: PropTypes.elementType.isRequired,
pageProps: PropTypes.object.isRequired,
};
30 changes: 0 additions & 30 deletions examples/material-ui-nextjs-pages-router/src/Link.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { useRouter } from 'next/router';
import NextLink from 'next/link';
Expand Down Expand Up @@ -39,19 +38,6 @@ export const NextLinkComposed = React.forwardRef(function NextLinkComposed(props
);
});

NextLinkComposed.propTypes = {
href: PropTypes.any,
legacyBehavior: PropTypes.bool,
linkAs: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
locale: PropTypes.string,
passHref: PropTypes.bool,
prefetch: PropTypes.bool,
replace: PropTypes.bool,
scroll: PropTypes.bool,
shallow: PropTypes.bool,
to: PropTypes.oneOfType([PropTypes.object, PropTypes.string]).isRequired,
};

// A styled version of the Next.js Link component:
// https://nextjs.org/docs/pages/api-reference/components/link
const Link = React.forwardRef(function Link(props, ref) {
Expand Down Expand Up @@ -105,20 +91,4 @@ const Link = React.forwardRef(function Link(props, ref) {
);
});

Link.propTypes = {
activeClassName: PropTypes.string,
as: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
className: PropTypes.string,
href: PropTypes.any,
legacyBehavior: PropTypes.bool,
linkAs: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
locale: PropTypes.string,
noLinkStyle: PropTypes.bool,
prefetch: PropTypes.bool,
replace: PropTypes.bool,
role: PropTypes.string,
scroll: PropTypes.bool,
shallow: PropTypes.bool,
};

export default Link;
5 changes: 0 additions & 5 deletions examples/material-ui-nextjs-ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ or:

[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/github/mui/material-ui/tree/master/examples/material-ui-nextjs-ts)

## Upgrading to Next.js 15

This example uses Next.js 14.
To upgrade to version 15, please follow the [official upgrade guide](https://nextjs.org/docs/app/building-your-application/upgrading/version-15) in the Next.js docs.

## Learn more

To learn more about this example:
Expand Down
2 changes: 1 addition & 1 deletion examples/material-ui-nextjs-ts/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
12 changes: 6 additions & 6 deletions examples/material-ui-nextjs-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
"@mui/icons-material": "latest",
"@mui/material": "latest",
"@mui/material-nextjs": "latest",
"next": "^14.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"next": "^15.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@types/node": "latest",
"@types/react": "latest",
"@types/react-dom": "latest",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"eslint": "latest",
"eslint-config-next": "^14.0.0",
"eslint-config-next": "^15.0.0",
"typescript": "latest"
}
}
5 changes: 0 additions & 5 deletions examples/material-ui-nextjs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ or:

[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/github/mui/material-ui/tree/master/examples/material-ui-nextjs)

## Upgrading to Next.js 15

This example uses Next.js 14.
To upgrade to version 15, please follow the [official upgrade guide](https://nextjs.org/docs/app/building-your-application/upgrading/version-15) in the Next.js docs.

## Learn more

To learn more about this example:
Expand Down
8 changes: 4 additions & 4 deletions examples/material-ui-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"@mui/material": "latest",
"@mui/material-nextjs": "latest",
"eslint": "latest",
"eslint-config-next": "^14.0.0",
"next": "^14.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"eslint-config-next": "^15.0.0",
"next": "^15.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
}
}

0 comments on commit 28c97e6

Please sign in to comment.