bvaughn / react-highlight-words

React component to highlight words within a larger body of text
https://bvaughn.github.io/react-highlight-words/
MIT License
2.16k stars 170 forks source link

textToHighlight must be the type of string? #83

Closed cctv1005s closed 5 years ago

cctv1005s commented 5 years ago

what happens?

When i pass a number variable to this props, i got an empty div in screen

And then i convert it to string, this component works..

So

Is this a bug or feature?

bvaughn commented 5 years ago

It's a string. It's in the docs: https://github.com/bvaughn/react-highlight-words#props

type: string