Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #403 I went with Matt's implementation as that seems to mirror React's implementation and it seems to work as intended. These examples now work ``` import deephaven.ui as ui from deephaven.ui import use_state @ui.component def counter(): count, set_count = use_state(0) on_press = ui.use_callback(lambda: set_count(lambda c: c + 1), []) return ui.action_button( f"You pressed me {count} times", on_press=on_press ) c = counter() ``` ``` import deephaven.ui as ui from deephaven.ui import use_state @ui.component def counter(): count, set_count = use_state(0) on_press = ui.use_callback(lambda _: set_count(count + 1), [count]) ui.use_effect(lambda: print('Effect'), [on_press]) return ui.action_button( f"You pressed me {count} times", on_press=on_press ) c = counter() ```
- Loading branch information