Skip to content

Commit

Permalink
fix(types): require complete state if setState's replace flag is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonom authored Jun 4, 2024
1 parent 018358c commit 76b4fbf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/vanilla.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
type SetStateInternal<T> = {
_(
partial: T | Partial<T> | { _(state: T): T | Partial<T> }['_'],
replace?: boolean | undefined,
replace?: false | undefined,
): void
_(
state: T | { _(state: T): T }['_'],
replace: true,
): void
}['_']

Expand Down

0 comments on commit 76b4fbf

Please sign in to comment.