jrainearwills
jrainearwills
Explore posts from servers
SSolidJS
Created by jrainearwills on 2/25/2025 in #support
Parent Get/Set Child Property
ok i took a look at the playground. makes sense, a factory function.
17 replies
SSolidJS
Created by jrainearwills on 2/25/2025 in #support
Parent Get/Set Child Property
i'll check that out. i wound up doing this in the mean time, which is less idiomatic, but it works.
interface Props {
tabs: {
label: string,
Tab: JSXElement
}[]
}

export function Tabs(props: Props) {
const labels = props.tabs.map(t => t.label)
return (
<Paper>
<List>
<For each={props.tabs}>
{(tab) => (
<ListItemButton>{tab.label}</ListItemButton>
)}
</For>
</List>
<For each={props.tabs}>
{(tab) => (tab.Tab)}
</For>
</Paper>
)
}
interface Props {
tabs: {
label: string,
Tab: JSXElement
}[]
}

export function Tabs(props: Props) {
const labels = props.tabs.map(t => t.label)
return (
<Paper>
<List>
<For each={props.tabs}>
{(tab) => (
<ListItemButton>{tab.label}</ListItemButton>
)}
</For>
</List>
<For each={props.tabs}>
{(tab) => (tab.Tab)}
</For>
</Paper>
)
}
17 replies
SSolidJS
Created by jrainearwills on 2/25/2025 in #support
Parent Get/Set Child Property
what if children are passed in as props to the parent, like in my example?
17 replies
SSolidJS
Created by jrainearwills on 10/25/2024 in #support
`createResource` for Create and Update Requests?
ultimately, i think that a way to toggle suspense manually would be great, perhaps via SuspenseContext.
3 replies
SSolidJS
Created by jrainearwills on 10/25/2024 in #support
`createResource` for Create and Update Requests?
I ask because i want to trigger Suspense during an update. I also don't want to update and refetch if i don't have to.
3 replies
SSolidJS
Created by jrainearwills on 9/17/2024 in #support
Client Only - Local Storage
i guess that i can move the localstorage part into a component.
7 replies
SSolidJS
Created by jrainearwills on 9/16/2024 in #support
Custom Accordion - Not Consistant
It worked! The old
<Box
ref={contentRef}
sx={{
overflow: "hidden",
transition: "max-height 0.3s ease",
maxHeight: expanded() ? `${contentRef.scrollHeight}px` : "0px",
}}
>
<Box sx={{ p: 2 }}>{props.content}</Box>
</Box>
<Box
ref={contentRef}
sx={{
overflow: "hidden",
transition: "max-height 0.3s ease",
maxHeight: expanded() ? `${contentRef.scrollHeight}px` : "0px",
}}
>
<Box sx={{ p: 2 }}>{props.content}</Box>
</Box>
The new
<div
ref={contentRef}
style={{
overflow: "hidden",
transition: "max-height 0.3s ease",
'max-height': expanded() ? `${contentRef.scrollHeight}px` : "0px",
}}
>
<Box sx={{ p: 2 }}>{props.content}</Box>
</div>
<div
ref={contentRef}
style={{
overflow: "hidden",
transition: "max-height 0.3s ease",
'max-height': expanded() ? `${contentRef.scrollHeight}px` : "0px",
}}
>
<Box sx={{ p: 2 }}>{props.content}</Box>
</div>
3 replies
SSolidJS
Created by jrainearwills on 9/15/2024 in #support
SolidStart - Server Only
FWIW I was able to use a a factory function in combination with "use server" like:
"use server"

function SuperSecret(){
return {
doThatThingWithSecrets: () => {
console.log("shhhhh")
}
}
}

export const SuperSecretCode = SuperSecret()
"use server"

function SuperSecret(){
return {
doThatThingWithSecrets: () => {
console.log("shhhhh")
}
}
}

export const SuperSecretCode = SuperSecret()
11 replies
SSolidJS
Created by jrainearwills on 9/15/2024 in #support
SolidStart - Server Only
i'm used to making separate web services, but i like the convenience of solidstart. afik the only reason to leverage "use server" is for convenience. is there another?
11 replies
SSolidJS
Created by jrainearwills on 9/15/2024 in #support
SolidStart - Server Only
better than nothing i guess. the lines are a little blurred here. it makes me queezy.
11 replies
SSolidJS
Created by jrainearwills on 9/15/2024 in #support
SolidStart - Server Only
yeah, but what if someone mistakenly uses a module that i don't want to ever reach the client? how do i say to the next developer or to myself "Hey don't use this on the client side!"
11 replies