Socket
Socket
Sign inDemoInstall

@types/react-syntax-highlighter

Package Overview
Dependencies
3
Maintainers
1
Versions
35
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
Maintainers
1
Install size
1.40 MB
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, 02 Jan 2020 23:19:08 GMT
  • Dependencies: @types/react
  • Global values: none

Credits

These definitions were written by Ivo Stratev (https://github.com/NoHomey), Aimee Gamble-Milner (https://github.com/ajgamble-milner), Guo Yunhe (https://github.com/guoyunhe), and Anirban Sengupta (https://github.com/anirban09).

FAQs

Last updated on 02 Jan 2020

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