nextjs-ts | Opinionated Next JS project boilerplate with TypeScript | State Container library
kandi X-RAY | nextjs-ts Summary
kandi X-RAY | nextjs-ts Summary
Opinionated Next JS 12 project boilerplate with TypeScript and Redux
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of nextjs-ts
nextjs-ts Key Features
nextjs-ts Examples and Code Snippets
Community Discussions
Trending Discussions on nextjs-ts
QUESTION
I want to setup a website with NextJS, TypeScript and mdx-js. I used yarn create next-app
to setup the project, then added typescript and mdx-js. I created a simple MDX file and imported it in index.tsx. When I run yarn dev
, the projects builds just fine and I can see the results in the browser.
As the structure of MDX files is not understood by the TS compiler initially, I created a global.d.ts file that tells that the default export of a loaded MDX file provides a JSX.Element:
...ANSWER
Answered 2021-Mar-29 at 07:14So as Ajeet Shah said in the comments, my error was to use JSX.Element
instead of React.ComponentType
.
The module declaration should look like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install nextjs-ts
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page