i am new to programming and learning typescript and i have been trying to understand and fix the eslint warning. i have code like below,
const handleRequestDelete = async () => { //eslint warning
try {
await deleteSomething({ variables: { ids }});
onSuccess();
} catch (error) {
const [{ status, title, description }] =
apolloErrorToNotifications(error);
onError(error);
throw error;
}
};
on line const handleRequestDelete it throws eslint warning like so.
warning JSX attribute values should not contain functions created in the same scope react-perf/jsx-no-new-function-as-prop
how could i fix this error. could someone help me. thanks.