Sha256: 9d2d5b0ae6d6096fa41e59772737c43b15ca315c65cbbe6335b07d89912ce82a
Contents?: true
Size: 900 Bytes
Versions: 107
Compression:
Stored size: 900 Bytes
Contents
/* @flow */ /* eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */ import Highlighter from 'react-highlight-words' import React from 'react' import classnames from 'classnames' import { globalProps } from '../utilities/globalProps.js' type HighlightProps = { className?: string, data?: string, id?: string, children?: React.Node, text?: string, highlightedText?: array<string>, } const Highlight = (props: HighlightProps) => { const { className = 'pb_highlight_kit', children, data, id, text, highlightedText = ['highlight'], } = props return ( <Highlighter autoEscape data={data} highlightClassName={classnames(globalProps(props), className)} highlightTag="span" id={id} searchWords={highlightedText} textToHighlight={text || children} /> ) } export default Highlight
Version data entries
107 entries across 107 versions & 1 rubygems