Open CodeWithMichal opened 3 years ago
Hi @LabuzzMichal. Is the question still relevant? Did you try to double-wrap the component with the HOC (I'm not sure that is the best way of doing this sort of stuff)? export default withAlert(InfoContext)(withAlert(ErrorContext)(App))
Hi, I am having difficulty using more than one context in component. Say I have two contexts: -InfoContext -ErrorContext
I know what to do if I want to use only one of them, since its simply:
export default withAlert(InfoContext)(App)
orexport default withAlert(ErrorContext)(App)
But how can I use both of them in component? I tried to pass both contexts, like:
export default withAlert(InfoContext, ErrorContext)(App)
however I stucked at this point. Any sugestions?Best regards, Michał