File tree 1 file changed +16
-13
lines changed
examples/create-react-app-typescript/src
1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -4,23 +4,26 @@ import './App.css';
4
4
console . log ( domToReact ) ;
5
5
console . log ( htmlToDOM ) ;
6
6
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
-
16
7
export default function App ( ) {
17
8
return (
18
9
< div className = "App" >
19
- { parser ( `
20
- <h2 style="font-family: 'Lucida Grande';">
10
+ { parse (
11
+ `
12
+ <h1 style="font-family: 'Lucida Grande';">
21
13
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
+ ) }
24
27
</ div >
25
28
) ;
26
29
}
You can’t perform that action at this time.
0 commit comments