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
undefined
onSuccess
onError
When receiving onSuccess/onError parameters externally, it's very common to handle it as optional, as in the following example:
type Props = { onSuccess?: (data: ...) => void; }; const Component: React.FC<Props> = ({ onSuccess }) => { const { ... } = useAsync(..., [...], { onSuccess }); };
In the current implementation, for this scenario, the default onSuccess (noop) will be replaced with undefined: https://github.com/slorber/react-async-hook/blob/master/src/index.ts#L128
noop
The text was updated successfully, but these errors were encountered:
Hey
Sorry, something went wrong.
my another answer
Successfully merging a pull request may close this issue.
When receiving
onSuccess
/onError
parameters externally, it's very common to handle it as optional, as in the following example:In the current implementation, for this scenario, the default
onSuccess
(noop
) will be replaced withundefined
:https://github.com/slorber/react-async-hook/blob/master/src/index.ts#L128
The text was updated successfully, but these errors were encountered: