Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language change bug in React #14

Open
liang0000 opened this issue Sep 25, 2023 · 0 comments
Open

Language change bug in React #14

liang0000 opened this issue Sep 25, 2023 · 0 comments

Comments

@liang0000
Copy link

liang0000 commented Sep 25, 2023

We encountered an issue that language is not changing in React while using your current example in documentation. Is it a bug or intended behaviour? Or are we implementing this library incorrectly?

Here is an interactive example: https://codesandbox.io/s/uc8gld

Above example code is using below code and already have solution by using widget.current.loadLanguage(languageCode)

useEffect(() => {
  if (!widget.current && container.current) {
    widget.current = new WidgetInstance(container.current, {
      startMode: "auto",
      doneCallback: doneCallback,
      errorCallback: errorCallback,
      language: language,
    });
  }
  return () => {
    if (widget.current !== undefined) widget.current.reset();
  };
}, [container, language]);

But also an issue for

    const captHook = useCaptchaHook({
    siteKey: siteKey,
    endpoint: 'GLOBAL1',
    language: languageCode,
    startMode: 'none',
    showAttribution: false,
  });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant