ai6
Explore posts from serversIntegrating IndexedDB with Solid.js for Real-time Updates
I can't think of anything specific about Solid and Indexeddb, just follow Solid best practices and Indexeddb best practices...
Only open database once and reuse the connection, think about when you want to load your data, be mindful of where you perform updates, etc.
You might want to check out solid-dexie
I'm not currently using it but I might switch to it since it looks pretty nice
5 replies
How to reactively set height of a element?
I am also curious about this. It might have something to do with tracking since it only runs on page load. I recently had a similar issue where a resource wouldn't load when it was put in a
<Switch>
block. I had assumed that that's a tracking context but I guess not. Maybe it's similar for you with <Motion>
. I am curious what happens when you call the ref ouside of the Motion block:
6 replies
createMemo accessor null value
Is there a reason why you can't use separate signals for that? I'm thinking, since
useFirestore
can have a nullable initial value, you could create an isLoading
signal which can be set to true until state.data?.uid
is loaded:
2 replies
Is there a good guide or howto on how to make (non solid) custom web components work with solidstart
from this issue, you can try this:
In my case, I could't get it to work with children and it only shows the default html element props which is not very useful for custom elements, so I gave up pretty quickly and just set it as
any
. You might have more luck than me though 🤷♂️6 replies
Is there a good guide or howto on how to make (non solid) custom web components work with solidstart
AFAIK web component should just work out of the box. I am currently building an app with them and the only issue was typescript support, I had to declare them like this:
6 replies
How to prevent component from unmounting on navigation?
From this article:
In Solid, all rendering and DOM interaction is a side effect of the reactive system. Even basics like mount/unmount are not based on DOM action. A reactive context is "mounted" when it has finished settling for the first time, and "unmounted" when its parent context is re-evaluated or removed.Since the
<Routes>
component re-evaluates on any route change, that means all of its children will be unmounted. So the solution is to just keep the component outside of <Routes>
!
Not sure what the implications or downsides of this are, but everything seems fine for now.2 replies