
Here’s a version of yesterday’s tip that uses the onChange modifier instead of a button to add up the values. This allows you to have the two numbers add up automatically when either of them changes. The closure for the modifier gets passed the value it changed to, but since both properties are local we don’t need…
Keep reading with a 7-day free trial
Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.