
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
react-static-plugin-typescript
Advanced tools
A React-Static plugin that adds support for typescript
A plugin for React Static that allows you to use TypeScript.
There instructions for enabling this plugin on existing projects below. When setting up a new project using React Static, you can simply select the TypeScript template after running react-static create
.
npm install react-static-plugin-typescript @types/react --save-dev
There are three steps to complete before being able to use this plugin.
First, add the plugin to your static.config.js
:
export default {
plugins: ['react-static-plugin-typescript'],
}
Then add a tsconfig.json
, e.g. this one:
{
"compilerOptions": {
"target": "es2015",
"module": "esnext",
"lib": ["es2015", "dom"],
"moduleResolution": "node",
"skipLibCheck": true,
"isolatedModules": true,
"noEmit": true,
"allowJs": true,
"jsx": "preserve",
"sourceMap": true,
"removeComments": false,
"strict": true,
"esModuleInterop": true
}
}
Finally, rename a file from .js
to .tsx
. You can then start using TypeScript!
Options can be passed by using an array, e.g.:
// In static.config.js:
export default {
plugins: [['react-static-plugin-typescript', { typeCheck: true }]],
}
typeCheck: boolean
Default value: true
Enable or disable type checking for your application during compilation. When this is off, your TypeScript files will still be loaded, but you won't get warnings about type errors unless you set that up separately, e.g. in your editor, a commit hook, or in your CI server. When this is on, your application will fail to run locally when there are type errors.
See CHANGELOG.md
.
MIT © Vincent Tunru
7.6.2
react-static-plugin-svgr
, because we have no publish rights.FAQs
A React-Static plugin that adds support for typescript
We found that react-static-plugin-typescript demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.