Context Provider Compose #2246
Answered
by
EricRovell
EricRovell
asked this question in
Q&A
-
I use My solution looks like this: import type { ParentComponent, ParentProps} from "solid-js";
const ProviderCompose = (props: Props) => (
<>
{props.components.reduceRight((acc, Component) => <Component>{acc}</Component>, props.children)}
</>
); And the usage like this: export const App = () => {
return (
<>
<ProviderCompose components={[ MetaProvider, SettingsProvider, TranslationProvider ]}>
<Routes />
</ProviderCompose>
</>
);
} But the problem is, it does not work. The error appears within |
Beta Was this translation helpful? Give feedback.
Answered by
EricRovell
Aug 4, 2024
Replies: 1 comment 1 reply
-
There's the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I see, there is MultiProvider utility. I will look how it is implemented, thanks!