react-highlight
react-highlight copied to clipboard
Different highlight background for different ranges
Hi, Instead of using the highlightStyle prop for all ranges, can I pass a property for each range indicating their background colour?
Hey!
Thanks for your message, do passing a function instead of an object for highlightStyle (with the range as argument) can solve your use case? If so I can make a change in the code to do so.
Let me know Yann
@132lilinwei up?
@ydeshayes Hey this is a brilliant project! Why don't you keep updating it?
@ydeshayes should solve our problem, can you update the lib, make highlightStyle accept a function with range as argument.
@gabrielbuzziv @132lilinwei Please check the 1.1.0-beta.0 version, you can now pass a function (the doc has been updated). (demo https://ydeshayes.github.io/react-highlight/)
this version contain a big refactor as well, so it need some tests.
Published in 1.1.0