Skip to content

Commit

Permalink
Add note about setValue JS function typing
Browse files Browse the repository at this point in the history
  • Loading branch information
greglittlefield-wf committed Oct 12, 2023
1 parent b277b9a commit e4f4faf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/hooks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class StateHook<T> {
final T _value;

/// The second item in the pair returned by [React.useState].
///
/// This has a type of `dynamic` since it accepts either the value `T`,
/// or an updater function `T Function(T)`.
final void Function(dynamic) _setValue;

StateHook._(this._value, this._setValue);
Expand Down

0 comments on commit e4f4faf

Please sign in to comment.