linkifyjs
linkifyjs copied to clipboard
turn off/on plugin per usage
We may have a few different uses on the same page at the same time. And while in one case a plugin can be valid, it can be totally opposite in another case. Is there any way to turn off/on plugins except the validate option? It can be really annoying to use fake validators each time:
<Linkify options={{ validate: { foo: () => false }}>...</Linkify>
<Linkify options={{ validate: { bar: () => false }}>...</Linkify>
<Linkify options={{ validate: { baz: () => false }}>...</Linkify>
Unfortunately this is the only way to do it. Note that you don't have to declare a function for each key, you can just set it to false
e.g.,
<Linkify options={{ validate: { foo: false }}>...</Linkify>
Can you suggest a better API to do this?