[01]Install dependencies
First, install the following dependencies:
npm install --save-dev typescript @types/react @types/react-dom
CORE CONCEPTS
Rasengan.js provides a TypeScript-first development experience for building your React application.
It comes with built-in TypeScript support for automatically installing the necessary packages and configuring the proper settings.
create-rasengan CLI can be used to create a new TypeScript project.
npx create-rasengan@latest my-app
During the project creation, you will be prompted to choose the language for your project. Select TypeScript to create a TypeScript project.
If you have an existing project and want to add TypeScript support, you have to follow the following steps:
npm install --save-dev typescript @types/react @types/react-dom
{ "compilerOptions": { "baseUrl": ".", "target": "ES2020", /* Bundler mode */ "moduleResolution": "bundler", "module": "ESNext", "jsx": "react-jsx", /* Aliases for intellisence */ "paths": { "@/*": ["src/*"] } }, "include": ["src", "rasengan-env.d.ts"], "extends": "./node_modules/rasengan/tsconfig.base.json" }
/// <reference types="rasengan/types/client" />
npm run dev