diff --git a/examples/nextjs/pages/index.tsx b/examples/nextjs/pages/index.tsx index 7b69a22f..1a51fd89 100644 --- a/examples/nextjs/pages/index.tsx +++ b/examples/nextjs/pages/index.tsx @@ -1,5 +1,5 @@ import Head from 'next/head'; -import parse from 'html-react-parser'; +import parse, { Element } from 'html-react-parser'; export default function Home() { return ( @@ -10,10 +10,23 @@ export default function Home() {

- {parse(` + {parse( + ` Welcome to Next.js and HTMLReactParser! - `)} + `, + { + replace(domNode) { + if (domNode instanceof Element && domNode.name === 'a') { + return ( + + Next.js + + ); + } + }, + }, + )}