Lesson 2 of 21 · Basics
State
state declares a value that can change. When it changes, Surface updates only the elements that read it. There is no virtual DOM, and there are no hooks or dependency lists. The compiler finds the dependencies.on:press runs a statement when a person presses the button. The keyboard and the pointer both work, because Button is a real button on each target.Your turn
- Add a second button with the text Reset.
- Set count to 0 when a person presses it.
Preview
1 error
The sandbox needs a browser.