()
| 5 | const counterInstance = createCounter() |
| 6 | |
| 7 | export default function App() { |
| 8 | const [count, setCount] = useState(counterInstance.getCount()) |
| 9 | |
| 10 | const increment = () => { |
| 11 | counterInstance.increment() |
| 12 | setCount(counterInstance.getCount()) |
| 13 | } |
| 14 | |
| 15 | const decrement = () => { |
| 16 | counterInstance.decrement() |
| 17 | setCount(counterInstance.getCount()) |
| 18 | } |
| 19 | |
| 20 | return ( |
| 21 | <div> |
| 22 | <h1>Custom plugins</h1> |
| 23 | <h2>Count: {count}</h2> |
| 24 | <div style={{ display: 'flex', gap: '4px' }}> |
| 25 | <button onClick={increment}>+ increase</button> |
| 26 | <button onClick={decrement}>− decrease</button> |
| 27 | </div> |
| 28 | </div> |
| 29 | ) |
| 30 | } |
nothing calls this directly
no outgoing calls
no test coverage detected