Skip to content

nozo-moto/string-replace-jsx

Repository files navigation

String-Replace-Jsx

npm GitHub stars GitHub license Node.js CI

What

The stringReplaceJsx method returns a new string with some or all matches of a pattern.

How to use

npm i --save string-replace-jsx

import stringReplaceJsx from "string-replace-jsx";

<div>
  {stringReplaceJsx("fuga https://google.com", urlRegex, (match) => (
    <a
      className={styles.link}
      href={match.toString()}
      target="_blank"
      rel="noreferrer"
    >
      {match}
    </a>
  ))}
</div>;