Issue with Highlighting Search Terms in react-highlight-words in Next.js Application #866
-
Hi everyone, I’m currently working on a Next.js project and trying to implement text highlighting using the react-highlight-words library. I have a component called EmotionCard where I need to highlight search terms within the notes field of the emotion object. Here’s what I’ve tried so far:
Despite this, nothing happens. The words are not highlighted, and no errors are showing up in the console. I’m also using styled-components in my project. Has anyone faced a similar issue or could provide some insights into how I can get this feature working correctly in a Next.js app? Any help or suggestions would be greatly appreciated! Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi Wladimir, I have not worked with this library yet, but I will gladly take a look and see if we can figure something out together. Can you share the branch with me where you tried implementing this feature? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
The underlying issue was that the |
Beta Was this translation helpful? Give feedback.
The underlying issue was that the
searchTerm
prop was undefined and we fixed it by passing it down from/pages/index.js
.