joemoe
joemoe
SSolidJS
Created by Harry Boter on 2/9/2025 in #support
Context provider breaks while using esbuild-plugin-solid
Here is a good answer on that topic with some sources attached to the answer https://stackoverflow.com/a/76273022/754854
5 replies
SSolidJS
Created by Harry Boter on 2/9/2025 in #support
Context provider breaks while using esbuild-plugin-solid
Agree with @Madaxen86 Instead of
export function CollectionProvider({ children }) {
const [title, setTitle] = createSignal("My title")

return (
<CollectionContext.Provider value={{ title }}>
{children}
</CollectionContext.Provider>
)
}
export function CollectionProvider({ children }) {
const [title, setTitle] = createSignal("My title")

return (
<CollectionContext.Provider value={{ title }}>
{children}
</CollectionContext.Provider>
)
}
Change it to
export function CollectionProvider(props) {
const [title, setTitle] = createSignal("My title")

return (
<CollectionContext.Provider value={{ title }}>
{props.children}
</CollectionContext.Provider>
)
}
export function CollectionProvider(props) {
const [title, setTitle] = createSignal("My title")

return (
<CollectionContext.Provider value={{ title }}>
{props.children}
</CollectionContext.Provider>
)
}
5 replies
SSolidJS
Created by joemoe on 5/29/2024 in #support
Are Record types a bad type for using stores in Solid?
I did not. I missed this part. They don't show an example in the example code. I just tested this and I can confirm that it does work. Thank you.
5 replies