Skip to content
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] Refactor to have better types in the Next.js + TypeScript examples #36355

Merged
merged 3 commits into from
Mar 7, 2023

Conversation

erikian
Copy link
Contributor

@erikian erikian commented Feb 26, 2023

Two minor typing changes in this example:

  • instead of using any as the type for the App component just so we don't get an error when using the emotionCache prop, we define a new component with the right props (the props from Next.js' AppType component, plus our MyAppProps defined in the _app.tsx file)
  • the EmotionJSX.Element type is just an alias for JSX.Element, so I think we can avoid this import here

@erikian erikian force-pushed the refactor/nextjs-ts-example-types branch from 9bb53d1 to 859d67c Compare February 26, 2023 15:00
@mui-bot
Copy link

mui-bot commented Feb 26, 2023

Netlify deploy preview

https://deploy-preview-36355--material-ui.netlify.app/

Bundle size report

No bundle size changes

Generated by 🚫 dangerJS against 1b6f1c9

@zannager zannager added the examples Relating to /examples label Feb 27, 2023
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Can you also update the same in material-next-ts-v4-v5-migration example folder?

examples/material-next-ts/pages/_document.tsx Outdated Show resolved Hide resolved
@ZeeshanTamboli ZeeshanTamboli changed the title [examples] refactor: better types in the Next.js + TypeScript example [examples] Refactor to suppport better types in the Next.js + TypeScript example Mar 6, 2023
@ZeeshanTamboli ZeeshanTamboli changed the title [examples] Refactor to suppport better types in the Next.js + TypeScript example [examples] Refactor to have better types in the Next.js + TypeScript example Mar 6, 2023
@erikian erikian force-pushed the refactor/nextjs-ts-example-types branch from 85f75e5 to 1b6f1c9 Compare March 6, 2023 14:38
@erikian erikian requested review from ZeeshanTamboli and removed request for mnajdova March 6, 2023 14:50
@ZeeshanTamboli ZeeshanTamboli changed the title [examples] Refactor to have better types in the Next.js + TypeScript example [examples] Refactor to have better types in the Next.js + TypeScript examples Mar 7, 2023
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erikian It's a great first pull request on MUI 👌 Thank you for working on it!

@ZeeshanTamboli ZeeshanTamboli merged commit 9c2bafe into mui:master Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples Relating to /examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants