We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DraftFunction
use-immer/src/index.ts
Line 4 in d0a2daa
It currently specifies void as the return type, but you can actually return a new object, like:
void
const [state, updateState] = useImmer({ some: "value" }); updateState(() => ({ new: "value" }));
From my observations, it's equivalent to:
updateState({ new: "value" });
I was trying to make a wrapper for the updater function and the wrong function signature tripped me up.
The text was updated successfully, but these errors were encountered:
Correct, encountering the same issue.
Sorry, something went wrong.
PR welcome
No branches or pull requests
use-immer/src/index.ts
Line 4 in d0a2daa
It currently specifies
void
as the return type, but you can actually return a new object, like:From my observations, it's equivalent to:
I was trying to make a wrapper for the updater function and the wrong function signature tripped me up.
The text was updated successfully, but these errors were encountered: