When injectScript is set to false (/manual-script-injection), the following browser warning appears:
It seems to be caused because the default callback name (onLoadCallbackName) has changed recently to include the container id (to allow multiple widgets on the same page). To fix it, we should also include the container id on the DEFAULT_ONLOAD_NAME constant.
Sometimes, the script is attempted to be injected multiple times and this log appears:
We can add an early check on the injectTurnstileScript function to fix it.
Sometimes, the clean-up function cannot remove the widget and the following log appears:
Seems it happens when a render option of the widget changes (e.g. options.theme) and causes the .remove() method to run twice in two different useEffect. Potentially fixed by checking if the element document.getElementById(widgetId) exists.
injectScript
is set tofalse
(/manual-script-injection
), the following browser warning appears:It seems to be caused because the default callback name (
onLoadCallbackName
) has changed recently to include the container id (to allow multiple widgets on the same page). To fix it, we should also include the container id on theDEFAULT_ONLOAD_NAME
constant.We can add an early check on the
injectTurnstileScript
function to fix it.Seems it happens when a render option of the widget changes (e.g.
options.theme
) and causes the.remove()
method to run twice in two differentuseEffect
. Potentially fixed by checking if the elementdocument.getElementById(widgetId)
exists.Related to #30