39 |
{title}
40 |
Current Count: {count}
41 | {data &&
Data Name: {data.name}
}
42 |
43 |
44 | {/* Self-closing tag */}
45 |
46 | {/* Fragment */}
47 | <>
48 |
Fragment content
49 | >
50 | {/* Conditional rendering */}
51 | {count > 5 &&
Count is greater than 5!
}
52 |
53 | );
54 | };
55 |
56 | // Another simple component
57 | function SimpleDiv() {
58 | return Just a simple div.
;
59 | }
60 |
61 | // Exporting the component
62 | export default MyComponent;
63 | export { SimpleDiv };
64 |
65 | // Top-level variable using JSX type
66 | let element: JSX.Element =