i'm wondering if there's any way to call API methods without inject each component ?
somthing like providing a function that will call intl.formatMessage for example
export function t(id,defaultmessage){
console.log("Called ",id,defaultmessage);
return intl.formatMessage(
{
id: id,
defaultMessage: defaultmessage
}
)
}
I would look into a state management library such as Redux. The data would then be passed into each component as a property, instead of having an API call in each component.