-
Notifications
You must be signed in to change notification settings - Fork 47
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