react-graphql-syntax-highlighter
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

GraphQL syntax highlighting React component

Installation

yarn add react-graphql-syntax-highlighter

Example usage

import { GraphQLCodeBlock } from 'react-graphql-syntax-highlighter';
import 'react-graphql-syntax-highlighter/dist/style.css';
import React from 'react';

interface Props {
  code: string;
}

export const GraphqlCodeBlock: React.FC<Props> = ({ code }) => (
  <GraphQLCodeBlock src={code} />
);

The components only takes two props: className and code. code is a graphql query string.

Readme

Keywords

Package Sidebar

Install

npm i react-graphql-syntax-highlighter

Weekly Downloads

2,360

Version

0.0.4

License

MIT

Unpacked Size

5.78 kB

Total Files

6

Last publish

Collaborators

  • simpod