Current API has useLocale (as well as useLocales).
Using that within a functional react component (that which can use hooks), triggers following error:
Failed to compile
./src/App.js
Line 65: React Hook "useLocale" is called in function "set_locale" which is neither a React function component or a custom React Hook function react-hooks/rules-of-hooks
Search for the keywords to learn more about each error.
(Here, set_locale is my own function).
It seems that whatever checker got installed with CRA considers use[A-Z].* to be a react hook 🤔
Current API has
useLocale
(as well asuseLocales
).Using that within a functional react component (that which can use hooks), triggers following error:
(Here,
set_locale
is my own function).It seems that whatever checker got installed with CRA considers
use[A-Z].*
to be a react hook 🤔So far I have this workaround:
Perhaps there's a better workaround?
Or, if all else fails,