Last post Jun 10, 2019 06:32 PM by Trixon
May 20, 2019 07:24 AM|rapolurohit|LINK
Currently we are working on SPA template of react and redux with typescript integration in .net core 2.0. Now we want to migrate our project to .net core 2.2 with react 16 version. The present SPA template of react 16 with .net core 2.2 doesn't have
typescript integration enabled. Could some one help me to configure typescript in react & redux template of new .net core 2.2 SPA template.
May 20, 2019 02:22 PM|bruce (sqlwork.com)|LINK
core 2.2 use the create-react-app scripts. delete the contents of ClientApp, cd to it, and following instructions
you could probably make sample project to above, and see what additional packages are added, and what additional script changes (switches) are in the project.json. I've never use typescript with react (react is going functional, and typescript is OO), so
can not help with the changes here.
the main difference with create-react-app is it build an index.html that has a reference to the SPA scripts, and spa services knows how to load this file, as the startup url via the spa static file handler.
the structure of the react projects is the same, and the index.html (template) is in the ClientApp/public folder.
May 21, 2019 06:51 AM|Xing Zou|LINK
Could some one help me to configure typescript in react & redux template of new .net core 2.2 SPA template.
There is no ASP.NET Core specific stuff within the ClientApp folder though. That means that you can easily remove the files there and recreate the app using the CLI tool. So if you want to use a TypeScript based React template, you could just delete the ClientApp
folder and recreate it using the create-react-app --typecript option. You are completely free to do whatever you want within the ClientApp folder, so you can just follow your own client-side development workflow there.
You could create React apps (with Typescript and Redux) using:
npx create-react-app my-app --scripts-version=react-scripts-redux-ts
May 21, 2019 04:08 PM|bruce (sqlwork.com)|LINK
but the spa support in asp.net core knows the structure of the clientapp folder. it knowns about the start & build script commands in the project.json, and that files in ClientApp/public should be exposed at the root. also it knows that index.html is the
Jun 10, 2019 06:32 PM|Trixon|LINK