diff options
Diffstat (limited to 'examples/framework-react/src/components/Counter.jsx')
-rw-r--r-- | examples/framework-react/src/components/Counter.jsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/framework-react/src/components/Counter.jsx b/examples/framework-react/src/components/Counter.jsx index 3ab6728e7..b7b219aae 100644 --- a/examples/framework-react/src/components/Counter.jsx +++ b/examples/framework-react/src/components/Counter.jsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; -export default function Counter({ children }) { - const [count, setCount] = useState(0); +export default function Counter({ children, count: initialCount }) { + const [count, setCount] = useState(initialCount); const add = () => setCount((i) => i + 1); const subtract = () => setCount((i) => i - 1); |