Skip to content

varsanyid/react-text-highlighter-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React TypeScript Text Highlighter Component

A high-order component which lets you highlight specific content in your component. Export your component the following way:

export default withHighlighting(component)

Check the tests for example usage.

let HighlightableMockComponent
let wrapper

beforeEach(() => {
    HighlightableMockComponent = ({text, highlight}) => <div>{text}</div>
    const HighLighterComponent = withHighlighting(HighlightableMockComponent)
    wrapper = mount(<HighLighterComponent text="I would like to highlight" highlight="like" />)
})

This component is not actively maintained and not meant to be used in production. Please take a look around npm, there are several solutions similar to this.

About

React TypeScript Text Highlighter Component

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published