Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { createSignal, onMount } from "solid-js";
- function App() {
- const [count, setCount] = createSignal(0);
- let input;
- onMount(() => {
- console.log("Everything is ready!")
- });
- return (
- <div>
- <input
- type="number"
- ref={input}
- placeholder="Enter a number"
- />
- <button onClick={() => setCount(count()+parseInt(input.value))}>
- Add
- </button>
- <p>{count()}</p>
- </div>
- )
- }
- export default App;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement