summaryrefslogtreecommitdiff
path: root/examples/framework-react/src/components/Counter.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'examples/framework-react/src/components/Counter.jsx')
-rw-r--r--examples/framework-react/src/components/Counter.jsx26
1 files changed, 13 insertions, 13 deletions
diff --git a/examples/framework-react/src/components/Counter.jsx b/examples/framework-react/src/components/Counter.jsx
index e222d680f..97ddf34c7 100644
--- a/examples/framework-react/src/components/Counter.jsx
+++ b/examples/framework-react/src/components/Counter.jsx
@@ -2,18 +2,18 @@ import React, { useState } from 'react';
import './Counter.css';
export default function Counter({ children, count: initialCount }) {
- const [count, setCount] = useState(initialCount);
- const add = () => setCount((i) => i + 1);
- const subtract = () => setCount((i) => i - 1);
+ const [count, setCount] = useState(initialCount);
+ const add = () => setCount((i) => i + 1);
+ const subtract = () => setCount((i) => i - 1);
- return (
- <>
- <div className="counter">
- <button onClick={subtract}>-</button>
- <pre>{count}</pre>
- <button onClick={add}>+</button>
- </div>
- <div className="counter-message">{children}</div>
- </>
- );
+ return (
+ <>
+ <div className="counter">
+ <button onClick={subtract}>-</button>
+ <pre>{count}</pre>
+ <button onClick={add}>+</button>
+ </div>
+ <div className="counter-message">{children}</div>
+ </>
+ );
}