Sha256: 09f863e2064524fa4e0ae4c57d6faa0cd2f96e3ada0d364836d6613d254eb3e5
Contents?: true
Size: 897 Bytes
Versions: 11
Compression:
Stored size: 897 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' 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="mark" id={id} searchWords={highlightedText} textToHighlight={text || children} /> ) } export default Highlight
Version data entries
11 entries across 11 versions & 1 rubygems