Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 25, 2024 via pnpm

@types/react 18.2.37

TypeScript definitions for react
Package summary
Share
0
issues
1
license
4
MIT
Package created
17 May 2016
Version published
7 Nov 2023
Maintainers
1
Total deps
4
Direct deps
3
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
4 Packages, Including:
@types/prop-types@15.7.12
@types/react@18.2.37
@types/scheduler@0.23.0
csstype@3.1.3
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

3
All Dependencies CSV
β“˜ This is a list of @types/react 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
@types/prop-types15.7.126.55 kBMIT
prod
@types/scheduler0.23.05.39 kBMIT
prod
csstype3.1.3180.02 kBMIT
prod

Visualizations

Frequently Asked Questions

What does @types/react do?

The npm package "@types/react" provides TypeScript definitions for React. This library is essential for developers using TypeScript with React, as it offers proper type checking and editor support for React components, functions, props, and other elements in your TypeScript-React codebase. Its goals are to maintain and enhance TypeScript's interaction with the React library.

How do you use @types/react?

Installing and using @types/react in your TypeScript-React project is simple and straightforward. After initializing your project and setting up React, you can add @types/react package to your development dependencies using npm or yarn - the standard package managers for JavaScript. Here is how you do this:

For npm:

npm install --save-dev @types/react

For Yarn:

yarn add --dev @types/react

After installation, TypeScript can recognize and validate types in your React code. For example, consider a React component:

import React, { FunctionComponent } from 'react';

type Props = {
  title: string;
  isActive: boolean;
};

const MyComponent: FunctionComponent<Props> = ({ title, isActive }) => (
  <div>
    {title} - {isActive ? "Active" : "Inactive"}
  </div>
);

export default MyComponent;

In this code, MyComponent is a React functional component that accepts a Props object. This Props object has been typed to contain title as a string and isActive as a boolean. @types/react helps TypeScript to understand and validate these types within your React code.

Where are the @types/react docs?

Regarding documentation for @types/react, they can be found directly from the source code on the GitHub repository DefinitelyTyped/DefinitelyTyped. The definitions for React are written and maintained by the contributors of the DefinitelyTyped repository. You can navigate to the "react" folder in the repository to see the TypeScript definitions and related comments describing the types and interfaces for React.