Create a react app react 18 with typescript

0 votes

I am trying to create react 18 app with TypeScript, I tried following this guide but I can't make it work. I can't add "types": ["react/next", "react-dom/next"] to tsconfig file. I'm getting error:

Cannot find type definition file for 'react-dom/next'.
  The file is in the program because:
    Entry point of type library 'react-dom/next' specified in compilerOptionsts
Cannot find type definition file for 'react-dom/next'.
  The file is in the program because:
    Entry point of type library 'react-dom/next' specified in compilerOptionsts

Also I can't import ReactDom from 'react-dom/client'; I'm getting this error:

Could not find a declaration file for module 'react-dom/client'. 'C:/Users/bansc/Desktop/youtube-channel/api-calls/my-app/node_modules/react-dom/client.js' implicitly has an 'any' type.
  If the 'react-dom' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom'ts(7016)
Jul 5 in TypeSript by Logan
• 2,140 points
10 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In TypeSript

0 votes
1 answer

How to use useState hook in React with TypeScript correctly?

Without any initial argument, the type of email and setEmail will ...READ MORE

answered Jun 10 in TypeSript by Nina
• 3,020 points
46 views
0 votes
0 answers

How can I create a navigational compass using Typescript and HTML?

I'm looking to display a compass heading ...READ MORE

Jul 13 in TypeSript by Logan
• 2,140 points
23 views
0 votes
1 answer

How to use useState hook in React with typescript correctly?

You can set a string type for it Explicit way: const ...READ MORE

answered Aug 3 in TypeSript by Abhinaya
• 760 points
16 views
0 votes
1 answer

Cast a JSON Object to a TypeScript class

I had the same issue and this ...READ MORE

answered May 31 in TypeSript by Nina
• 3,020 points
92 views
0 votes
1 answer

How to use next-seo for setting nextjs meta tag with multiple OGP images?

https://github.com/garmeeh/next-seo use this git repo that contains ...READ MORE

answered Feb 24 in Others by narikkadan
• 11,280 points
464 views
0 votes
1 answer
0 votes
1 answer

Typescript: Property "XXX" does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes

Double check the newly added object types. ...READ MORE

answered Jun 8 in TypeSript by Nina
• 3,020 points
2,626 views
0 votes
1 answer

TypeScript - ',' expected.ts(1005)

You can't put statements in JSX curly braces, only expressions. You ...READ MORE

answered Jun 9 in TypeSript by Nina
• 3,020 points
607 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP