You can stick types to JavaScript code, that's named "TypeScript Type Declaration", and the extension is .d.ts. When TypeScript (or also an editor with intellisense) sees a javascript file and a .d.ts file with the same name, it will import the type definitions from that file.

There's a project that aims to provide type definitions for every JavaScript library, maybe you've heard talking about DefinitelyTyped.

For example:

// example.js
function hello(name) {
  console.log(`Hello ${name}!`);
}


// example.d.ts
function hello(name: string);


// main.ts
import { hello } from 'example';
hello(42); // Error! "name" must be a string

The same system has been used to provide types in React

Answer from Christian Vincenzo Traina on Stack Overflow
🌐
GitHub
github.com › tduyng › react-typescript-example
GitHub - tduyng/react-typescript-example: Template React Project using create-react-app & TypeScript · GitHub
@types: Declare modules, interface, type for TypeScript
Starred by 52 users
Forked by 19 users
Languages   TypeScript 81.3% | SCSS 10.0% | HTML 6.6% | JavaScript 2.1%
🌐
TypeScript
typescriptlang.org › docs › handbook › react.html
TypeScript: Documentation - React
Today there are many frameworks ... Here are some of the best places to find up-to-date information on React and TypeScript: ... The TypeScript docs are an open source project....
🌐
GitHub
github.com › typescript-cheatsheets › react
GitHub - typescript-cheatsheets/react: Cheatsheets for experienced React developers getting started with TypeScript · GitHub
Cheatsheets for experienced React developers getting started with TypeScript - typescript-cheatsheets/react
Starred by 47K users
Forked by 4.3K users
Languages   JavaScript 93.9% | CSS 5.8% | Shell 0.3%
🌐
GitHub
github.com › luciancaetano › base-react-typescript-project
GitHub - luciancaetano/startercraft: An opinionated boilerplate designed to accelerate the development of modern, scalable React applications with TypeScript. · GitHub
An opinionated boilerplate designed to accelerate the development of modern, scalable React applications with TypeScript. This template is especially suited for projects that require high scalability and complexity, promoting a clean architecture, ...
Starred by 22 users
Forked by 7 users
Languages   TypeScript 56.3% | Handlebars 18.6% | JavaScript 15.6% | CSS 7.5% | HTML 1.8% | SCSS 0.2%
🌐
GitHub
github.com › reactjsexample › react-typescript-example
GitHub - reactjsexample/react-typescript-example: React TypeScript Example. ReactJS TypeScript. Convert JSX to TSX. React Router TypeScript. React Fetch TypeScript. React TypeScript Best Practices. React TypeScript Architecture for large scale apps.
This is a good way to see how to convert an existing React app to React TypeScript. ... You need to have Node and NPM installed on your PC. ... Download the source code using git or else download and unzip the zip file.
Starred by 32 users
Forked by 14 users
Languages   TypeScript 84.7% | CSS 10.4% | HTML 4.9% | TypeScript 84.7% | CSS 10.4% | HTML 4.9%
Find elsewhere
🌐
React TypeScript Cheatsheets
react-typescript-cheatsheet.netlify.app › codebases
Recommended React + TypeScript codebases to learn from | React TypeScript Cheatsheets
https://github.com/Microsoft/TypeScript-React-Native-Starter · TS Library Codebases to study · https://github.com/Azure/azure-sdk-for-js · https://github.com/sindresorhus/is · https://github.com/probot/probot · https://github.com/intuit/auto ...
🌐
Create React App
create-react-app.dev › docs › adding-typescript
Adding TypeScript | Create React App
You are not required to make a tsconfig.json file, one will be made for you. You are allowed to edit the generated TypeScript configuration.
🌐
GitHub
github.com › topics › react-typescript
react-typescript · GitHub Topics · GitHub
react typescript reactjs nextjs monorepo turbo pnpm tailwind tailwindcss monorepo-example react-typescript monorepo-starter next-typescript turborepo turborepo-example shadcn-ui pnpm-monorepo turborepo-starter turbo-starter ... React Typescript Login and Registration example - JWT Authentication & Authorization with Axios, Router, Rest API
🌐
ThemeSelection
themeselection.com › home › blog › collections › 10+ inspirational react typescript example github
10+ Inspirational React Typescript Example GitHub
August 28, 2024 - Looking for a React Typescript example for inspiration? Then this is the right place where you will find the best React Typescript Example Github. Before we start the list. let's learn a bit about Typescript and React. Table of contentsWhat Is React?What is Typescript?Benefits of using Typescr
🌐
GitHub
github.com › microsoft › TypeScript-React-Starter
GitHub - microsoft/TypeScript-React-Starter: A starter template for TypeScript and React with a detailed README describing how to use the two together. · GitHub
November 16, 2023 - src contains our TypeScript and CSS code. index.tsx is the entry-point for our file, and is mandatory. images.d.ts will tell TypeScript that certain types of image files can be import-ed, which create-react-app supports.
Starred by 11.1K users
Forked by 1.2K users
Languages   TypeScript 74.3% | HTML 16.4% | CSS 9.3%
🌐
GitHub
github.com › Lemoncode › react-typescript-samples
GitHub - Lemoncode/react-typescript-samples: The goal of this project is to provide a set of simple samples, providing and step by step guide to start working with React and Typescript. · GitHub
The goal of this project is to provide a set of simple samples, providing and step by step guide to start working with React and TypeScript. We have incorporated a set of examples based on hooks. ... Hooks: set of samples migrated to hooks (right now 15 samples migrated), if you are new to React, or you are going to start working on a new project, We recommend you going through these examples. Old_class_components_samples: The old samples, just in case you need to work with older react versions or you need to maintain legacy code.
Starred by 1.9K users
Forked by 389 users
Languages   TypeScript 86.3% | JavaScript 10.5% | CSS 2.3% | HTML 0.9%
🌐
React
react.dev › learn › typescript
Using TypeScript – React
You can learn about how TypeScript describes objects in Object Types but you may also be interested in using Union Types to describe a prop that can be one of a few different types and the Creating Types from Types guide for more advanced use cases. The type definitions from @types/react include types for the built-in Hooks, so you can use them in your components without any additional setup. They are built to take into account the code ...
🌐
Medium
medium.com › @devinabbott › react-react-native-typescript-javascript-open-source-tutorials-resources-on-my-github-dee238c52ef0
React, React Native, TypeScript & JavaScript — Open Source Tutorials & Resources on my GitHub | by Devin Abbott | Medium
July 20, 2022 - I recommend using it alongside the React docs, especially for people who like learning through interactive examples. Again, React Express includes open source code snippets that are copyable and customizable for use in your own React projects — for example, drag and drop UX. TypeScript Express (on my GitHub here) covers TypeScript from the ground up.
🌐
Rheinwerk Computing
blog.rheinwerk-computing.com › using-typescript-in-a-react-application
Using TypeScript in a React Application
March 19, 2025 - This command-line tool checks the TypeScript source code of your application and transforms it into valid JavaScript source code that can be run in the browser. For this transformation to work, the typescript package must be installed on your system.
🌐
LogRocket
blog.logrocket.com › home › how to use typescript with react: a tutorial with examples
How to use TypeScript with React: A tutorial with examples - LogRocket Blog
June 4, 2024 - Now that we’ve gone over a general overview, let’s get to the installation. You can install TypeScript using either npm or Create React App. To install TypeScript globally using npm, run either of the following commands in your terminal: ... The code above will print out the version number of TypeScript installed.
🌐
Hands on React
handsonreact.com › introduction
React Tutorial using TypeScript | Hands on React
Build a project management application step-by-step in React by following the directions below. This is a preview of the application you will build. ... A snapshot of the finished solution code at the completion of each of the above labs is available in this repository.
🌐
React Native
reactnative.dev › docs › typescript
Using TypeScript · React Native
February 20, 2026 - Out of the box, TypeScript sources are transformed by Babel during bundling. We recommend that you use the TypeScript compiler only for type checking. This is the default behavior of tsc for newly created applications. If you have existing TypeScript code being ported to React Native, there are one or two caveats to using Babel instead of TypeScript.
🌐
Educative
educative.io › answers › create-react-app-typescript
Create React App Typescript
The project root directory contains configuration files like package.json and tsconfig.json. Inside the src folder, you'll find the TypeScript source code files, including App.tsx as the main entry point.