Answers for "how to replace strings with react components"

0

how to replace strings with react components

import { replaceReact } from "replace-react";

const MyApp = () => {
  return (
    <div>
      {replaceReact("hello world", /(world)/g, (match, key) => (
        <h1 key={key}>{match}</h1>
      ))}
    </div>
  );
};
Posted by: Guest on April-20-2021

Code answers related to "how to replace strings with react components"

Code answers related to "Javascript"

Browse Popular Code Answers by Language