Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upOffer Link wrapper component in TSX #22807
Comments
|
@brokenthorn I'm not sure to follow. Are you reporting an issue with? material-ui/examples/nextjs-with-typescript/src/Link.tsx Lines 37 to 39 in 814fb60 |
|
I think that we can aim to link all the examples in https://next.material-ui.com/getting-started/example-projects/#official-examples, so do: diff --git a/docs/src/pages/getting-started/example-projects/example-projects.md b/docs/src/pages/getting-started/example-projects/example-projects.md
index aba703ac5c..23d9424374 100644
--- a/docs/src/pages/getting-started/example-projects/example-projects.md
+++ b/docs/src/pages/getting-started/example-projects/example-projects.md
@@ -13,7 +13,6 @@ You can find some example projects in the [GitHub repository](https://github.com
- [CDN](https://github.com/mui-org/material-ui/tree/next/examples/cdn)
- [Plain server-side](https://github.com/mui-org/material-ui/tree/next/examples/ssr)
- [Use styled-components as style engine](https://github.com/mui-org/material-ui/tree/next/examples/create-react-app-with-styled-components-engine)
-- And more
Create React App is an awesome project for learning React.
Have a look at [the alternatives available](https://github.com/facebook/create-react-app/blob/master/README.md#popular-alternatives) to see which project best fits your needs. |
|
@brokenthorn do you want to solve that? |
|
@oliviertassinari, I can take this issue if @brokenthorn is not looking into it. |
…://github.com/Avi98/material-ui into docs/mui-org#22807/added-all-examples-to-docs
mui-org#22807/added-all-examples-to-example
The styled and wrapped version of the Next.js
Linkcomponent provided by the Material UI next-js template/example is not 100% usable in TypeScript projects because IntelliSense does not work with the current JavaScript version of the component. For example, there are no suggestions available for its props.I converted the JS version to TSX partially. It is usable and IntelliSense works in VS-Code. I am missing just one more type, as far as I can tell. I've noted it with a TODO comment in this code gist.
Summary💡
The
Linkcomponent should be usable in other TSX components and provide IntelliSense in editors like VS-Code.Examples🌈
Motivation🔦
I, like many others, prefer TypeScript over JavaScript and this is the only official starter template for Next.js + Material UI, but it is only JS-oriented. At the moment, the Next.js template only contains a few demo components which will be deleted anyway, but the
Linkcomponent is usable. It would be great if there was a TSX version of it as well.