Socket
Socket
Sign inDemoInstall

@types/react-syntax-highlighter

Package Overview
Dependencies
3
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/react-syntax-highlighter

TypeScript definitions for react-syntax-highlighter


Version published
Weekly downloads
1.4M
increased by5.76%
Maintainers
1
Install size
1.74 MB
Created
Weekly downloads
 

Package description

What is @types/react-syntax-highlighter?

The @types/react-syntax-highlighter package provides TypeScript type definitions for the react-syntax-highlighter package. This allows developers using TypeScript to integrate syntax highlighting in their React applications with type safety, ensuring that the props and options they use with react-syntax-highlighter are correctly typed.

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

Syntax Highlighting in React Components

This code sample demonstrates how to use react-syntax-highlighter with TypeScript in a React component to highlight JavaScript code. It imports a specific syntax highlighting style and applies it to a code snippet.

import React from 'react';
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import { dark } from 'react-syntax-highlighter/dist/esm/styles/prism';

const Component = () => (
  <SyntaxHighlighter language='javascript' style={dark}>
    {`const a = 'Hello, world!';`}
  </SyntaxHighlighter>
);

Other packages similar to @types/react-syntax-highlighter

Readme

Source

Installation

npm install --save @types/react-syntax-highlighter

Summary

This package contains type definitions for react-syntax-highlighter (https://github.com/conorhastings/react-syntax-highlighter).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-syntax-highlighter.

Additional Details

  • Last updated: Mon, 04 Dec 2023 17:35:44 GMT
  • Dependencies: @types/react

Credits

These definitions were written by Ivo Stratev, Guo Yunhe, Anirban Sengupta, Michael Yuen, and Dokyun Kim.

FAQs

Last updated on 04 Dec 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc