mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
Preserve reactivity in Solid example component (#5386)
This commit is contained in:
parent
df8092b007
commit
eab4a0279f
1 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
import { createSignal } from 'solid-js';
|
||||
import './Counter.css';
|
||||
|
||||
export default function Counter({ children }) {
|
||||
export default function Counter(props) {
|
||||
const [count, setCount] = createSignal(0);
|
||||
const add = () => setCount(count() + 1);
|
||||
const subtract = () => setCount(count() - 1);
|
||||
|
@ -13,7 +13,7 @@ export default function Counter({ children }) {
|
|||
<pre>{count()}</pre>
|
||||
<button onClick={add}>+</button>
|
||||
</div>
|
||||
<div class="counter-message">{children}</div>
|
||||
<div class="counter-message">{props.children}</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue