UNPKG

@shhhplus/react-text-matcher

Version:

A React component that matches text using specified rules, supporting string and regular expressions.

2 lines (1 loc) 262 B
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("@shhhplus/text-matcher");module.exports=function(u){var n=u.text,c=u.rules,i=u.children,s=r.useMemo((function(){return t(c).exec(n)}),[c,n]);return e.jsx(e.Fragment,{children:i(s)})};