Open
Description
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
Metadata
Metadata
Assignees
Labels
No labels