Created
April 23, 2019 17:40
-
-
Save stolinski/2d9545e19dd67bda64143cb1aae04ac0 to your computer and use it in GitHub Desktop.
Revisions
-
stolinski created this gist
Apr 23, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ function ProviderComposer({ contexts, children }) { return contexts.reduceRight( (kids, parent) => React.cloneElement(parent, { children: kids, }), children ); } function ContextProvider({ children }) { return ( <ProviderComposer contexts={[<CheckoutProvider />, <LoginProvider />, <AlertProvider />]} > {children} </ProviderComposer> ); } export { ContextProvider };