File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed
examples/create-react-app-typescript/src Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -4,23 +4,26 @@ import './App.css';
44console . log ( domToReact ) ;
55console . log ( htmlToDOM ) ;
66
7- const parser = ( input : string ) =>
8- parse ( input , {
9- replace : domNode => {
10- if ( domNode instanceof Element && domNode . attribs . class === 'remove' ) {
11- return < > </ > ;
12- }
13- }
14- } ) ;
15-
167export default function App ( ) {
178 return (
189 < div className = "App" >
19- { parser ( `
20- <h2 style="font-family: 'Lucida Grande';">
10+ { parse (
11+ `
12+ <h1 style="font-family: 'Lucida Grande';">
2113 HTMLReactParser<br class="remove"> with Create React App (TypeScript)
22- </h2>
23- ` ) }
14+ </h1>
15+ ` ,
16+ {
17+ replace ( domNode ) {
18+ if (
19+ domNode instanceof Element &&
20+ domNode . attribs . class === 'remove'
21+ ) {
22+ return < > </ > ;
23+ }
24+ } ,
25+ }
26+ ) }
2427 </ div >
2528 ) ;
2629}
You can’t perform that action at this time.
0 commit comments