Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bs-react-diff-viewer

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bs-react-diff-viewer

ReasonML bindings for react-diff-viewer library

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

bs-react-diff-viewer

Build Status dependencies Status devDependencies Status peerDependencies Status Greenkeeper badge

ReasonML bindings for react-diff-viewer library.

Installation

npm i --save bs-react-diff-viewer react-diff-viewer

Then add bs-react-diff-viewer as a dependency to bsconfig.json.

Usage

[@react.component]
let make = (~before, ~after) => {
  let renderContent = content =>
    <SyntaxHighlighter language=`JavaScript>
      content
    </SyntaxHighlighter>;
  <ReactDiffViewer
    oldValue=before
    newValue=after
    compareMethod=`words
    splitView=false
    renderContent
    styles={ReactDiffViewer.Styles.make(
      ~wordDiff=Styles.wordDiff,
      ~content=Styles.content,
      ~contentText=Styles.contentText,
      ~lineNumber=Styles.lineNumber,
      ~gutter=Styles.gutter,
      ~diffContainer=Styles.diffContainer,
      (),
    )}
  />;;
};

JSX 2

The package provides fallback for projects using older version of JSX syntax.

let component = ReasonReact.statelessComponent("Demo");

let make = (~before, ~after, _children) => {
  ...component,
  render: (_self) => {
    let renderContent = content =>
      <SyntaxHighlighter language=`JavaScript>
        {...content}
      </SyntaxHighlighter>;
    <ReactDiffViewer.Jsx2
      oldValue=before
      newValue=after
      compareMethod=`words
      splitView=false
      renderContent
      styles={ReactDiffViewer.Styles.make(
        ~wordDiff=Styles.wordDiff,
        ~content=Styles.content,
        ~contentText=Styles.contentText,
        ~lineNumber=Styles.lineNumber,
        ~gutter=Styles.gutter,
        ~diffContainer=Styles.diffContainer,
        (),
      )}
    />;
  }
};

Keywords

FAQs

Package last updated on 05 Jul 2020

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