Socket
Socket
Sign inDemoInstall

@types/react-syntax-highlighter

Package Overview
Dependencies
1
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/react-syntax-highlighter


Version published
Maintainers
1
Created

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: Thu, 28 Apr 2022 23:31:45 GMT
  • Dependencies: @types/react
  • Global values: none

Credits

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

FAQs

Last updated on 28 Apr 2022

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc