0.3.1 • Published 2 years ago
@opencreek/provider-stack v0.3.1
Provider Stack
Are you tired of the mountain of react providers, just lying in your app.tsx? This simple library solves that for you!
Usage
// app.tsx
import { providers, ProviderStack } from "@opencreek/provider-stack"
// Somewhere in your app component
const theme = //...
const providerStack = useMemo(() =>
providers()
.add(ThemeProvider, {theme: theme})
.add(SomeOtherProvider),
[theme] // make sure to add everything that needs to trigger an update
)
return (
<ProviderStack providers={providerStack}>
// Rest of your app
</ProviderStack>
)
Some more Detail
providers()
.add(ThemeProvider, { theme: theme }) // The second parameter are the props of the provider (excluding `children`)
.add(SomeOtherProvider) // If no props are needed, you can just leave them out!
0.3.1
2 years ago
0.3.1--canary.5.1452293463.0
2 years ago
0.3.1--canary.5.1452276191.0
2 years ago
0.3.0
2 years ago
0.3.0--canary.4.1450555634.0
2 years ago
0.2.2
2 years ago
0.2.2--canary.3.1450539597.0
2 years ago
0.2.1
2 years ago
0.2.1--canary.2.1450518093.0
2 years ago
0.2.1--canary.2.1450511514.0
2 years ago
0.2.0
2 years ago
0.1.1--canary.1.1450482984.0
2 years ago
0.1.1--canary.1.1450452048.0
2 years ago
0.1.1--canary.1.1450388859.0
2 years ago