Offer Link wrapper component in TSX
See original GitHub issueThe styled and wrapped version of the Next.js Link
component 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.
- I have searched the issues of this repository and believe that this is not a duplicate.
Summary 💡
The Link
component 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 Link
component is usable. It would be great if there was a TSX version of it as well.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
@oliviertassinari, I can take this issue if @brokenthorn is not looking into it.
Sorry I’m late. I had other pressing projects keeping me busy (and tired).
Yes, that is what I was referring to. The nextjs-with-typescript example had/has a custom Link component that wraps Next.js’s Link component, and that custom component was unusable in TS projects. The gist I gave tried to fix that.
Anyway I’m still busy on another project so it will be a while until I get back to this. This stemmed from a personal project which is now on hold.