New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-syntax-highlighter-virtualized-renderer

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-syntax-highlighter-virtualized-renderer

a virtualized custom renderer for react syntax highlighter

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
288
decreased by-27.64%
Maintainers
1
Weekly downloads
 
Created
Source

React Syntax Highlighter Virtualized Renderer

React Syntax Highlighter allows for the use of custom renderers to change the behavior of the way the syntax highlighted code is rendered. This module utilizes React Virtualized to virtualize rendering of non visible code nodes to allow for better performance when syntax highlighting large blocks. See an example: here

Use

npm install react-syntax-highlighter --save
npm install react-syntax-highlighter-virtualized-renderer --save
import SyntaxHighlighter from 'react-syntax-highlighter';
import virtualizedRenderer from 'react-syntax-highlighter-virtualized-renderer'; 
import { docco } from 'react-syntax-highlighter/dist/styles';
const Component = () => {
  const codeString = '(num) => num + 1';
  return (
	<SyntaxHighlighter 
	  language='javascript' 
	  style={docco}
	  renderer={virtualizedRenderer()}
  	>
  		{codeString}
  	</SyntaxHighlighter> 
  );
}

Optional Options Argument

  • overscanRowCount - number of rows to render ahead of what is currently visible. (defaults to 10)
  • rowHeight - if you use different fonts / line height styles, you made need to adjust the row height (defaults to 15)

Keywords

FAQs

Package last updated on 22 Mar 2017

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc