You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@types/react-dom

Package Overview
Dependencies
Maintainers
1
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/react-dom

Type definitions for React v0.14 (react-dom) from https://www.github.com/DefinitelyTyped/DefinitelyTyped


Version published
Weekly downloads
17M
increased by0.83%
Maintainers
1
Install size
336 kB
Created
Weekly downloads
 

Package description

What is @types/react-dom?

The @types/react-dom package provides TypeScript type definitions for React DOM. It's used in TypeScript projects to enable type checking and IntelliSense for React DOM APIs. This package is essential for developers working with React in a TypeScript environment, as it enhances code quality and developer productivity by providing compile-time type checking and autocompletion.

What are @types/react-dom's main functionalities?

Rendering Elements

This feature allows you to render React elements to the DOM. The code sample demonstrates how to use ReactDOM.render() to render an element into the DOM in the simplest way.

import ReactDOM from 'react-dom';

const element = <h1>Hello, world!</h1>;
ReactDOM.render(element, document.getElementById('root'));

Portals

Portals provide a way to render children into a DOM node that exists outside the DOM hierarchy of the parent component. The code sample shows how to create a portal.

import ReactDOM from 'react-dom';

const portalRoot = document.getElementById('portal-root');
const element = <div>Portal Example</div>;
ReactDOM.createPortal(element, portalRoot);

Server-side Rendering

This feature is for server-side rendering of React components to HTML. The code sample demonstrates how to use renderToString() to render a component to a static HTML string, which can then be sent to the client for a faster initial load.

import { renderToString } from 'react-dom/server';

const element = <div>Server Side Rendering</div>;
const htmlString = renderToString(element);

Other packages similar to @types/react-dom

Readme

Source

Installation

npm install --save-dev @types/react-dom

Summary

This package contains type definitions for React v0.14 (react-dom).

The project URL or description is http://facebook.github.io/react/

Credits

These definitions were written by Asana https://asana.com, AssureSign http://www.assuresign.com, Microsoft https://microsoft.com.

Details

Typings were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped in the react-dom directory.

Additional Details

  • Last updated: Tue, 17 May 2016 18:05:07 GMT
  • Typings kind: UMD
  • Library Dependencies: none
  • Module Dependencies: react
  • Global values: ReactDOM

FAQs

Package last updated on 17 May 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc