I am developing a text area that contains some specific words(Eg. they can start/end with "%": %QWERTY%). I want these words to have a different color(E.g: Green) and the text area is still editable. I have tried some solutions but they do not work as I expected, that is why I would like to ask the community how to implement a text input area.
My code is here https://codesandbox.io/s/festive-cache-sshmjd?file=/src/TagsInput.js
In the 1st and 2nd inputs, I classified words and used map() to display them in tags, however, they became separated inputs, not combine into a single one
In the 3rd input, I implemented a for the special word, but this is a fixed string, and I do not know how to implement it like a state variable to detect any changes in the input area.
Could somebody review my code and help?