()
| 1 | import * as React from "./react/core"; |
| 2 | |
| 3 | export const Bar = () => { |
| 4 | const [isRenderingSpan, setIsRenderingSpan] = React.useState(false); |
| 5 | const [x, setX] = React.useState(2); |
| 6 | return React.createElement( |
| 7 | "area", |
| 8 | {}, |
| 9 | React.createElement(Foo, null), |
| 10 | React.createElement("button", { |
| 11 | innerText: "conditional render", |
| 12 | onclick: () => { |
| 13 | setIsRenderingSpan(!isRenderingSpan); |
| 14 | }, |
| 15 | }), |
| 16 | React.createElement("button", { |
| 17 | innerText: `Count: ${x}`, |
| 18 | onclick: () => { |
| 19 | setX(x + 1); |
| 20 | }, |
| 21 | }), |
| 22 | isRenderingSpan && |
| 23 | React.createElement("span", { |
| 24 | style: |
| 25 | "display:flex; height:50px; width:50px; background-color: white;", |
| 26 | }) |
| 27 | ); |
| 28 | }; |
| 29 | |
| 30 | export const ConditionalRender = () => { |
| 31 | const [isRenderingSpan, setIsRenderingSpan] = React.useState(false); |
nothing calls this directly
no outgoing calls
no test coverage detected