S
SolidJS•2mo ago
lord

Grouping/Combining multiple context providers

Does anyone know how I can group multiple context providers to my <App /> Without nesting a bunch of it?
4 Replies
DevTech
DevTech•2mo ago
import React, { useContext } from 'react'; import { Context1, Context2, Context3 } from './contexts'; function MyApp() { // Access multiple contexts const dataFromContext1 = useContext(Context1); const dataFromContext2 = useContext(Context2); const dataFromContext3 = useContext(Context3); // Your component logic using data from multiple contexts return ( <div> {/* Your JSX */} </div> ); } export default MyApp;
REEEEE
REEEEE•2mo ago
GitHub
solid-primitives/packages/context at main · solidjs-community/solid...
A library of high-quality primitives that extend SolidJS reactivity. - solidjs-community/solid-primitives
REEEEE
REEEEE•2mo ago
This is not a React server 🙂
lord
lord•2mo ago
Thanks this is what i was looking for
Want results from more Discord servers?
Add your server
More Posts
Solid.js onClick event is not firing when app is in ShadowRoot.Solid.js onClick event is not firing when app is in ShadowRoot. Registered clicks only to component UnoCSS installation issue related to ESM importsHi. I just started a brand new solid project and then added UnoCSS. But does not seem to work, it giReloading Wasm or Reloading Pagehello everyone. I am trying to host some games I made with Raylib and Zig and compiled to wasm on myHydration mismatchThe following code ALWAYS raises hydration mismatch while using solid-start with SSR. But that's notform action Breaking On Second SubmitTo learn about actions, I built a simple notes app. The app displays a list of notes. When you clickIs there a way to skip the createResource query until a parameter is available?Something similar to Tanstack Query or Apollo, maybe? ```ts const [collations] = createResource( The requestEvent in the middleware is different from requestEvent from getRequestEvent in the samerequest cycle This is leading to some weird bugsOn the server, `getRequestEvent()` sometimes returns nullThis happens not that frequently, but still happens. I am calling a function from middleware. In tComponent that can render a different tag depending on prop?I want to make a title that renders a different component depending on the `as` props you give it. Hydrating SSR - <Hydrate /> doesn't seem to rehydrate dehydrated appThis is what my SSR (and client) entry looks like ```ts import {ErrorBoundary, Hydration, Hydration