How to use the prism-react-renderer/themes/vsDark.plain function in prism-react-renderer

To help you get started, we’ve selected a few prism-react-renderer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LekoArts / gatsby-starter-minimal-blog / src / components / Code.js View on Github external
/* eslint react/jsx-boolean-value: 0 */
/* eslint no-unused-vars: 0 */
/* eslint react/prop-types: 0 */
/* eslint react/destructuring-assignment: 0 */
import React from 'react'
import Highlight, { defaultProps } from 'prism-react-renderer'
import theme from 'prism-react-renderer/themes/vsDark'
import { LiveProvider, LiveEditor, LiveError, LivePreview } from 'react-live'
import styled from 'styled-components'

const StyledEditor = styled(LiveEditor)`
  background: ${theme.plain.backgroundColor};
  border-radius: 5px;
  margin-bottom: 1rem;
`

const Code = ({ codeString, language, ...props }) => {
  if (props['react-live']) {
    return (
      
        
        
        
      
    )
  }
  return (

prism-react-renderer

Renders highlighted Prism output using React

MIT
Latest version published 5 months ago

Package Health Score

90 / 100
Full package analysis

Similar packages