Skip to content

Commit 0b70d89

Browse files
chore(examples): tidy create-react-app-typescript/src/App.tsx
1 parent 53dcc20 commit 0b70d89

File tree

1 file changed

+16
-13
lines changed
  • examples/create-react-app-typescript/src

1 file changed

+16
-13
lines changed

examples/create-react-app-typescript/src/App.tsx

+16-13
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,26 @@ import './App.css';
44
console.log(domToReact);
55
console.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-
167
export 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
}

0 commit comments

Comments
 (0)