I want to create a new file that will contain helper functions for several components that using the same logic,
The issue is that I need to use my locale.ts file in that file for using the current language according to the theme (localization)
but it seems I can't call const t: any = useTheme().props in ts file.
(error: React Hook "useTheme" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function)
today in my tsx component files:
t: any = useTheme().props
t.General.someString
How can I use localization of the Material-UI theme in my helper functions file?