关键字高亮
    https://github.com/bvaughn/react-highlight-words
    pnpm add react-highlight-words

    1. import React from 'react';
    2. import Highlighter from "react-highlight-words";
    3. const App: React.FC = () => {
    4. return (
    5. <Highlighter
    6. highlightClassName="YourHighlightClass"
    7. searchWords={["and", "or", "the"]}
    8. autoEscape={true}
    9. textToHighlight="The dog is chasing the cat. Or perhaps they're just playing?"
    10. />
    11. )
    12. }
    13. export default App