I installed the most recent .NET Core SDK. From Visual Studio (NOT VS Code) I chose the ASP.NET Core React template. The web site runs fine. Great. But when I try to use TypeScript I run into problems:
When I add a .tsx file, I get a compilation error.
Cannot use JSX unless the '--jsx' flag is provided.When I try to use Jest by typing
npm testfrom the command line, it runs tests. Good. But when I put a test into a TypeScript file, I get compilation errors likeCannot find name expect. When I try to use instructions for using TypeScript with Jest I start running into compilation errors complaining about my package.json -These options in your package.json Jest configuration are not currently supported by Create React App.
Aren't these templates supposed to provide a ready-to-go works-out-of-the-box experience? I can't believe that what I'm trying to do here is unusual - using Jest with TypeScript and using TypeScript to define a TSX component. The create-react-app template with typescript provides these facilities without ANY hassles. It just works. Am I doing something wrong here? Am I not understanding the purpose of ASP.NET Core? I want to be able to build my front-end with React and have a nice C#-backed solid web site inside a project I can build and debug with Visual Studio. Too much to ask?