From fae4772ac7234facd45b6db9aa584c5aaceef5da Mon Sep 17 00:00:00 2001 From: Ivan Voskoboinyk Date: Fri, 26 Aug 2022 17:23:14 +0300 Subject: [PATCH] No need to wrap `onError` into another function --- src/components/HtmlInjection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/HtmlInjection.tsx b/src/components/HtmlInjection.tsx index b45b3479..7f72e8b5 100644 --- a/src/components/HtmlInjection.tsx +++ b/src/components/HtmlInjection.tsx @@ -34,7 +34,7 @@ function useScripts(html: Props['html'], onError: Props['onError']) { const script = document.createElement('script'); setScriptAttributes(script, attributes); - script.addEventListener('error', () => onError()); + script.addEventListener('error', onError); document.body.appendChild(script); });