febri
febri
SSolidJS
Created by febri on 8/26/2024 in #support
Signal lost its reactivity when passed into another function
6 replies
SSolidJS
Created by febri on 8/19/2024 in #support
solid-transition-group not working inside createRoot
What im trying to do I want a function that i can call such that i can just inject element where ever i want, this is useful for creating like confirmation. So currently if i want some kind of floating widget that is not always present AKA dynamically show up, im gonna need to create signal and then use that signal to fire <Show />, which is fine for form theyre sometime already huge so adding <Show /> wouldnt be much work. But in the case of simpler things like mere confirmation, i gotta first put that confirmation inside a <Show /> and then create 2 signal one for checking if the element is open and the other for confirmation answer (which is neccessary). and then i gotta make sure that everything is done after that confirmation closed (using effects and such). But now i have made myself a little function to create element outside of the current context so i can just call it where ever. this is the core function
interface IPopUpProps {
children: JSXElement
}

export default function popup(_children: () => JSXElement, on_close?: () => void) {
let close: () => void;

createRoot((dispose) => {
let _child: Element | undefined;
close = () => {
dispose()
_child?.remove();
on_close?.();
}
_child = children(_children)() as Element;
document.body.appendChild(_child);
})
return { close };
}
interface IPopUpProps {
children: JSXElement
}

export default function popup(_children: () => JSXElement, on_close?: () => void) {
let close: () => void;

createRoot((dispose) => {
let _child: Element | undefined;
close = () => {
dispose()
_child?.remove();
on_close?.();
}
_child = children(_children)() as Element;
document.body.appendChild(_child);
})
return { close };
}
7 replies
SSolidJS
Created by febri on 10/29/2023 in #support
Error boundary wont catch error
No description
18 replies
SSolidJS
Created by febri on 10/21/2023 in #support
How do i create library?
I have this component that render svg from specified url, i dont see it anywhere library that does this. Id like to publish it but i have zero knowledge on building library? Been searching on google but i didnt find any. If anyone know an guide on how to do this or simply a keyword to search to id be grateful, thanks!
3 replies
SSolidJS
Created by febri on 10/20/2023 in #support
Load more button
Heres the scenario, i have signal of an array which hold list of words. Then i show them with <For /> component. Now i dont fetch all words in single fetch, i have "load more" button if you need more word. Now the problem is i dont know how to fetch and push new words to the signal. My initial thought was to put that array of words inside another signal array of pages, then we iterate each page with <For/> and we then iterate each word. The problem was when i fetch more pages everything get re-rendered which cause a blink. How do i get around this? Any suggestion?
11 replies
SSolidJS
Created by febri on 10/8/2023 in #support
How do i deploy solidjs app to github-pages?
No description
4 replies