I have a function that I am using for string externalization to translate and localize the content of a site.
const t = (string_to_trans) => {
return lang[string_to_trans];
}
I would like to make the function t globally accessible in all components. I've found that I can do it by attaching it to global or window like
global.t = t
without my App.js file, however to call that, I seem to have to use
global.t('string_to_trans');
Is there a way of not having to use global or window to do this so I can call it using only
t('string_to_trans');